diff --git a/django/utils/numberformat.py b/django/utils/numberformat.py
index dcccc99..3f61a66 100644
a
|
b
|
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
|
47 | 47 | int_part_gd = '' |
48 | 48 | for cnt, digit in enumerate(int_part[::-1]): |
49 | 49 | if cnt and not cnt % grouping: |
50 | | int_part_gd += thousand_sep |
| 50 | int_part_gd += thousand_sep[::-1] |
51 | 51 | int_part_gd += digit |
52 | 52 | int_part = int_part_gd[::-1] |
53 | 53 | return sign + int_part + dec_part |
diff --git a/tests/utils_tests/test_numberformat.py b/tests/utils_tests/test_numberformat.py
index 84ba378..4357906 100644
a
|
b
|
class TestNumberFormat(TestCase):
|
26 | 26 | self.assertEqual(nformat('1234', '.', grouping=2, thousand_sep=',', |
27 | 27 | force_grouping=True), '12,34') |
28 | 28 | self.assertEqual(nformat('-1234.33', '.', decimal_pos=1), '-1234.3') |
| 29 | self.assertEqual(nformat('10000', '.', grouping=3, |
| 30 | thousand_sep='comma', force_grouping=True), |
| 31 | '10comma000') |
29 | 32 | |
30 | 33 | def test_large_number(self): |
31 | 34 | most_max = ('{}179769313486231570814527423731704356798070567525844996' |