mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
BUG: Some futures prices need more precision when rounding
This commit is contained in:
committed by
David Michalowicz
parent
d4054f7522
commit
41aa212617
@@ -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