Overflow error using BigNumber.from #2463
Unanswered
rahulrumalla
asked this question in
Q&A
Replies: 1 comment 2 replies
-
For larger integers, consider using BigInt or HexString |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I'm using the Ethplorer API to fetch the balances and when I try to convert these using BigNumber (to display balance in web app), the library throws an error. I'm wondering what the right way to do this is.
Error
Uncaught (in promise) Error: overflow (fault="overflow", operation="BigNumber.from", value=12300000000000000, code=NUMERIC_FAULT, version=bignumber/5.5.0)
API data
https://api.ethplorer.io/getTopTokenHolders/0x2d94aa3e47d9d5024503ca8491fce9a2fb4da198?apiKey=freekey
BigNumber.from(1.23e+16) --> works
BigNumber.from(1.23e+17) --> throws an overflow error
Beta Was this translation helpful? Give feedback.
All reactions