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

Amount precision #1

Open
sevastos opened this issue Dec 23, 2013 · 3 comments
Open

Amount precision #1

sevastos opened this issue Dec 23, 2013 · 3 comments

Comments

@sevastos
Copy link
Contributor

Due to the nature of number handling on javascript numbers with more than 15-16 significant digits can produce loss of precision.

The best solution to my knowledge is to handle the amounts as strings and use a bignum library for the arithmetic.

@Marak
Copy link
Member

Marak commented Dec 23, 2013

+1 This needs to be fixed.

It would be great if you could alter the test suite to properly include the missing coverage, then add bignumber to make the tests pass again.

@sevastos
Copy link
Contributor Author

Hey Marak,
In order to be fully protected from losses it needs to deal with "strings" in and out, meaning that the returned on callbacks number result.amount, result.currencies.BTC.amount and others should be either strings or bignumber instances, but that will be a breaking change.

@Marak
Copy link
Member

Marak commented Dec 24, 2013

That's okay, we can make those stings.

sevastos added a commit to sevastos/resource-wallet that referenced this issue Dec 24, 2013
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