Closed NotoriousPyro closed 1 week ago
https://github.com/jup-ag/terminal/pull/82 This PR should fix that
Doesn't seem to be fixed...
As soon as toFixed
is called (https://github.com/jup-ag/terminal/pull/82/files#diff-07efa3ad56d0dc57c345fd62ecdef9c8892a1bf5e798d7d2d29161c374d29ec9R38), the precision is lost... the only way to do it is use strings and BigNumbers/Decimal. The field would have to be changed to a string field... As soon as anything is parsed into a number in JS, it is turned into a floating point number and suffers the same fate. Alternatively, using bigint and converting to strings as needed...
Image pretty much explains it, but when you have a very small amount of something and click MAX, it is rounding it to a much larger number... so
0.00000026
is being round to2.67
which is out by roughly~10⁷