[StaggeredOrders] handle very low prices
GuillaumeDSM opened this issue · comments
Guillaume De Saint Martin commented
problem:
python number rounding when very low prices can make huge differences
-_- commented
Even when prices are not very short numbers there are issues with floating point numbers:
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 2.3+2.4
4.699999999999999
That can be fixed with the decimal
module for eg:
>>> from decimal import Decimal
>>> Decimal('2.3')+Decimal('2.4')
Decimal('4.7')