Fix bug in Decimal __format__ method that swapped left and right

alignment.
This commit is contained in:
Mark Dickinson 2009-03-17 18:01:03 +00:00
parent 8cbe9556cf
commit b065e52bc2
3 changed files with 11 additions and 2 deletions

View file

@ -704,6 +704,12 @@ class DecimalFormatTest(unittest.TestCase):
('.0g', '-sNaN', '-sNaN'),
('', '1.00', '1.00'),
# check alignment
('<6', '123', '123 '),
('>6', '123', ' 123'),
('^6', '123', ' 123 '),
('=+6', '123', '+ 123'),
]
for fmt, d, result in test_values:
self.assertEqual(format(Decimal(d), fmt), result)