mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-10 11:50:32 +08:00
BUG: Some futures prices need more precision when rounding
This commit is contained in:
committed by
David Michalowicz
parent
8579ce7b1a
commit
c9351d4c18
@@ -0,0 +1,13 @@
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from zipline.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)
|
||||
Reference in New Issue
Block a user