beancount_periodic/common/number_test.py
raw| 1 | import unittest |
| 2 | from .number import * |
| 3 | |
| 4 | |
| 5 | class MyTestCase(unittest.TestCase): |
| 6 | def test_remove_exponent_zero(self): |
| 7 | self.assertEqual(remove_exponent_zero(Decimal('0.11100000')), Decimal('0.111')) |
| 8 | self.assertEqual(remove_exponent_zero(Decimal('100.000000')), Decimal('100')) |
| 9 | self.assertEqual(str(remove_exponent_zero(Decimal('0.100000'))), '0.1') |
| 10 | |
| 11 | |
| 12 | if __name__ == '__main__': |
| 13 | unittest.main() |