Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#8557 closed (duplicate)

intpoint filter for contrib.humanize

Reported by: Nicola Owned by: nobody
Component: Template system Version: dev
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

for european users would be really useful an intpoint filter in contrib.humanize,

here is the necessary code (similar to intcomma)

def intpoint(value):

"""
Converts an integer to a string containing point every three digits.
For example, 3000 becomes '3.000' and 45000 becomes '45.000'.
"""
orig = force_unicode(value)
new = re.sub("(-?\d+)(\d{3})", '\g<1>.\g<2>', orig)
if orig == new:

return new

else:

return intpoint(new)

intpoint.is_safe = True
register.filter(intpoint)

hope this would be in 1.0,

thanks
drakkan

Change History (5)

comment:1 by Jacob, 16 years ago

milestone: 1.0

We're well past feature freeze for 1.0.

comment:2 by Ivan Giuliani, 16 years ago

milestone: post-1.0

comment:3 by Chris Beaven, 16 years ago

Triage Stage: UnreviewedDesign decision needed

comment:4 by Chris Beaven, 16 years ago

Resolution: duplicate
Status: newclosed

See #9037 (it has a patch)

comment:5 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top