Converting BigNumber values to numbers (at any point really), causes errors due to the lack of floating point precision in the JS number type. This isue manifests itself in a number of ways:
Rounding errors (causing #475)
Conversion errors, whereby a subsequent string conversion (to scientific notation) renders the number unsuitable for use in further UI interactions, such as here
Solution
values should never be converted to numbers, and should stay as strings and mutated using BigNumber operations
Converting
BigNumber
values to numbers (at any point really), causes errors due to the lack of floating point precision in the JSnumber
type. This isue manifests itself in a number of ways:Solution
values should never be converted to numbers, and should stay as strings and mutated using
BigNumber
operations