Ticket #13810: number_format.patch
File number_format.patch, 790 bytes (added by , 14 years ago) |
---|
-
django/utils/numberformat.py
26 26 dec_part = dec_part[:decimal_pos] 27 27 else: 28 28 int_part, dec_part = str_number, '' 29 if decimal_pos: 29 # allow decimal_pos = 0, i.e. no decimal part 30 if decimal_pos >= 0: 30 31 dec_part = dec_part + ('0' * (decimal_pos - len(dec_part))) 32 # truncate decimal part, if required 33 if len(dec_part) > decimal_pos and decimal_pos >= 0: 34 dec_part = dec_part[0:decimal_pos] 31 35 if dec_part: dec_part = decimal_sep + dec_part 32 36 # grouping 33 37 if settings.USE_L10N and settings.USE_THOUSAND_SEPARATOR and grouping: