Ticket #9037: humanize_intcomma_locale_specific.diff
File humanize_intcomma_locale_specific.diff, 577 bytes (added by , 16 years ago) |
---|
-
contrib/humanize/templatetags/humanize.py
29 29 For example, 3000 becomes '3,000' and 45000 becomes '45,000'. 30 30 """ 31 31 orig = force_unicode(value) 32 new = re.sub("^(-?\d+)(\d{3})", '\g<1>,\g<2>', orig) 32 sep = _(',') 33 repl = '\g<1>%s\g<2>' % sep 34 new = re.sub("^(-?\d+)(\d{3})", repl, orig) 33 35 if orig == new: 34 36 return new 35 37 else: