-
Notifications
You must be signed in to change notification settings - Fork 198
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
toNano(1e-7) produces inadequate result #58
Comments
We are on it, thank you for reporting this! |
I've created an upstream issue: ethjs/ethjs-unit#6. |
Fixed in the upstream library: ethjs/ethjs-unit#7. |
@mcnckc thanks for the report! This is a bug in the ethjs-unit that tonweb is using. Fixed in tonweb 0.0.42. Since using Numbers in a crypto is basically a bad practice, in version 0.0.42, in addition to fixing the ethjs-unit, we forbade passing Numbers as an argument at all. Please pass numbers as strings or BN objects. This breaks backwards compatibility a bit, but I think it's a good idea to allow developers to avoid precision bugs. |
@mcnckc please contact @ton_bugs_bot to get bounty reward |
Afz185 |
toNano(1e-6)
works fine buttoNano(1e-7).toNumber()
results in2377000000000
on my machine.It seems like it is exactly the reason why one can't send less than
1e-6
TON using the web wallet based on this library - https://ton.app/wallets/web-ton-wallet.Correct me if I'm wrong, but by the standard one should be able to send less than
1000
nanoTON, despite it doesn't seem like a critical issue.I know that the average fee is much greater.
The text was updated successfully, but these errors were encountered: