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

rounding for amounts ? #11

Open
bvandenbon opened this issue Apr 12, 2021 · 1 comment
Open

rounding for amounts ? #11

bvandenbon opened this issue Apr 12, 2021 · 1 comment

Comments

@bvandenbon
Copy link

to round the prices I use the pricePrecision which is provided by the market() function.
is there a similar precision for the amounts. e.g. ETH should be 2 decimals I think, while XRP seems to be 0 decimals I think.

@roerdinkholder
Copy link

For amounts, there isn't a precision, but rather an amount of decimals. These can be acquired from the 'assets' call.
Make sure you understand precision and decimals are NOT the same. Take the number 3543.3526246, formatted with 5 decimals this becomes 3543.35262. Formatted with precision 5, it becomes 3543.4.

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