pickle-finance / pickle-ui

UI to interact with the PICKLE protocol
https://app.pickle.finance
51 stars 51 forks source link

Conversion of BigNumber strings to Number causes problems #493

Closed larrythecucumber321 closed 2 years ago

larrythecucumber321 commented 2 years ago

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:

Solution

values should never be converted to numbers, and should stay as strings and mutated using BigNumber operations