mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #25920 -- Added support for non-uniform NUMBER_GROUPING.
This commit is contained in:
@@ -576,6 +576,18 @@ class FormattingTests(SimpleTestCase):
|
||||
self.assertEqual('-66666.6', nformat(-66666.666, decimal_sep='.', decimal_pos=1))
|
||||
self.assertEqual('-66666.0', nformat(int('-66666'), decimal_sep='.', decimal_pos=1))
|
||||
self.assertEqual('10000.0', nformat(self.l, decimal_sep='.', decimal_pos=1))
|
||||
self.assertEqual(
|
||||
'10,00,00,000.00',
|
||||
nformat(100000000.00, decimal_sep='.', decimal_pos=2, grouping=(3, 2, 0), thousand_sep=',')
|
||||
)
|
||||
self.assertEqual(
|
||||
'1,0,00,000,0000.00',
|
||||
nformat(10000000000.00, decimal_sep='.', decimal_pos=2, grouping=(4, 3, 2, 1, 0), thousand_sep=',')
|
||||
)
|
||||
self.assertEqual(
|
||||
'10000,00,000.00',
|
||||
nformat(1000000000.00, decimal_sep='.', decimal_pos=2, grouping=(3, 2, -1), thousand_sep=',')
|
||||
)
|
||||
# This unusual grouping/force_grouping combination may be triggered by the intcomma filter (#17414)
|
||||
self.assertEqual('10000', nformat(self.l, decimal_sep='.', decimal_pos=0, grouping=0, force_grouping=True))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user