diff --git a/django/utils/numberformat.py b/django/utils/numberformat.py
index c6528c0..6418406 100644
a
|
b
|
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', f
|
13 | 13 | * thousand_sep: Thousand separator symbol (for example ",") |
14 | 14 | |
15 | 15 | """ |
16 | | use_grouping = force_grouping or settings.USE_L10N and \ |
17 | | settings.USE_THOUSAND_SEPARATOR and grouping |
| 16 | use_grouping = (force_grouping or settings.USE_L10N and |
| 17 | settings.USE_THOUSAND_SEPARATOR) and grouping |
18 | 18 | # Make the common case fast: |
19 | 19 | if isinstance(number, int) and not use_grouping and not decimal_pos: |
20 | 20 | return mark_safe(unicode(number)) |
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index cc17d74..92ad431 100644
a
|
b
|
class FormattingTests(TestCase):
|
329 | 329 | self.assertEqual(u'-66666.6', nformat(-66666.666, decimal_sep='.', decimal_pos=1)) |
330 | 330 | self.assertEqual(u'-66666.0', nformat(int('-66666'), decimal_sep='.', decimal_pos=1)) |
331 | 331 | self.assertEqual(u'10000.0', nformat(self.l, decimal_sep='.', decimal_pos=1)) |
| 332 | # The weird grouping/force_grouping combination may be triggered by intcomma filter (#17414) |
| 333 | self.assertEqual(u'10000', nformat(self.l, decimal_sep='.', decimal_pos=0, grouping=0, force_grouping=True)) |
332 | 334 | |
333 | 335 | # date filter |
334 | 336 | self.assertEqual(u'31.12.2009 в 20:50', Template('{{ dt|date:"d.m.Y в H:i" }}').render(self.ctxt)) |