mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-28 01:44:29 +08:00
14 lines
418 B
Python
14 lines
418 B
Python
|
|
from unittest import TestCase
|
|
|
|
from catalyst.utils.math_utils import number_of_decimal_places
|
|
|
|
|
|
class MathUtilsTestCase(TestCase):
|
|
|
|
def test_number_of_decimal_places(self):
|
|
self.assertEqual(number_of_decimal_places(1), 0)
|
|
self.assertEqual(number_of_decimal_places(3.14), 2)
|
|
self.assertEqual(number_of_decimal_places('3.14'), 2)
|
|
self.assertEqual(number_of_decimal_places(-3.14), 2)
|