Ticket #9037: humanize_intcomma_locale_specific.diff

File humanize_intcomma_locale_specific.diff, 577 bytes (added by erickd, 15 years ago)
  • contrib/humanize/templatetags/humanize.py

     
    2929    For example, 3000 becomes '3,000' and 45000 becomes '45,000'.
    3030    """
    3131    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)
    3335    if orig == new:
    3436        return new
    3537    else:
Back to Top