MAX button removes decimal separator when sending USDT
Describe the bug MAX button removes decimal point/separator when trying to send USDT
To Reproduce (REQUIRED) Needs test to reproduce
- Go to USDT (balance 58.500)
- Click on MAX
- Amount to be sent automatically shows 58,500,000.000 USDT
Screenshots
Reported on Twitter: https://twitter.com/davecraige/status/1287282730917560321
I could not reproduce it. However I see balance as 58.5 instead of 58.500. Are you still experiencing this issue?
I did an initial investigation into this issue, though was unable to reproduce. this looked alarmingly as though it could have been caused as a side effect of https://github.com/MetaMask/eth-token-tracker/commit/2896f88a7f8411f9e46b893c2fc31321478634fe but after careful investigation, I do not believe this to be a potential cause.
The input field on this form is the 'token-input' component rendered in the 'send.component' file. This Send component's container sets up a token contract object when a token is selected from the dropdown list of assets. The balance is pulled via eth_call and requesting the current address' token balance for the specified token. Once we get the balance in hex format from eth_call we have to convert it ourselves. I believe that, if there is a reproducible bug here,it would be in the conversion mechanism
After a few failed attempts to reproduce, and a year since the question "Are you still experiencing this issue?" was last asked, I think we can close this.