mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Fixed #24181 -- Fixed multi-char THOUSAND_SEPARATOR insertion
Report and original patch by Kay Cha.
Backport of 540ca563de from master.
This commit is contained in:
committed by
Claude Paroz
parent
edbf6de753
commit
b44a56c308
@@ -47,7 +47,7 @@ def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
|
||||
int_part_gd = ''
|
||||
for cnt, digit in enumerate(int_part[::-1]):
|
||||
if cnt and not cnt % grouping:
|
||||
int_part_gd += thousand_sep
|
||||
int_part_gd += thousand_sep[::-1]
|
||||
int_part_gd += digit
|
||||
int_part = int_part_gd[::-1]
|
||||
return sign + int_part + dec_part
|
||||
|
||||
Reference in New Issue
Block a user