Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[StaggeredOrders] handle very low prices #67

Open
GuillaumeDSM opened this issue May 8, 2019 · 1 comment
Open

[StaggeredOrders] handle very low prices #67

GuillaumeDSM opened this issue May 8, 2019 · 1 comment

Comments

@GuillaumeDSM
Copy link
Member

problem:
python number rounding when very low prices can make huge differences

@damajor
Copy link

damajor commented Mar 14, 2021

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')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants