Replies: 1 comment 1 reply
-
Make sure you read through all the notes in BigNumber too. The BigNumber class is only for integers; for performing fixed-point maths, ethers provides the Make sure when searching issues, you include closed issues, there is a lot on BigNumbers. Possibly too many to filter through. :) |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Describe the bug
Small numbers like
1.2
cannot be turned in BigNumbers.Reproduction steps
Search Terms
BigNumber, float, underflow, fraction
After a bit of digging, it looks like BigNumber.from() should only be called with integers? If this is correct, it would be great if this could be added to the docs as it's a bit of a foot gun. Alternately, could from() call Number.isInteger() when it receives input of type number?
Beta Was this translation helpful? Give feedback.
All reactions