1
0
mirror of https://github.com/django/django.git synced 2025-10-29 16:46:11 +00:00

Fixed #13810 -- Truncate numbers correctly when given number of decimal positions is zero. Thanks, milosu and Łukasz Rekucki.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16074 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-04-22 12:03:10 +00:00
parent 0e9692bc66
commit 01d0bf011e
2 changed files with 4 additions and 3 deletions

View File

@@ -171,6 +171,7 @@ class FormattingTests(TestCase):
settings.USE_THOUSAND_SEPARATOR = False
self.assertEqual(u'66666.66', nformat(self.n, decimal_sep='.', decimal_pos=2, grouping=3, thousand_sep=','))
self.assertEqual(u'66666A6', nformat(self.n, decimal_sep='A', decimal_pos=1, grouping=1, thousand_sep='B'))
self.assertEqual(u'66666', nformat(self.n, decimal_sep='X', decimal_pos=0, grouping=1, thousand_sep='Y'))
settings.USE_THOUSAND_SEPARATOR = True
self.assertEqual(u'66,666.66', nformat(self.n, decimal_sep='.', decimal_pos=2, grouping=3, thousand_sep=','))