Closed Lykhoyda closed 3 months ago
@mpetrunic @Lykhoyda how many decimals do we want to display if user clicks on max? currently we display 4. Do we want to adjust that?
Way too complicated. Can you redo PR by using following code:
Math.floor(Number.parseFloat(utils.formatUnits(BigNumber.from("28999999998000000000"), 18))*10000) / 10000
I agree it's more complicated, but it will work with bigger numbers. Might be overkill for this scenario as we have max 18 decimals. So I replace the code with yours
@mpetrunic @wainola the code didn't work with values with 16 decimals, so I had to change the method tokenBalanceToNumber to do the operations with the BigNumbers.
Closes #124 #123