MetaMask / MetaMask/metamask-extension
[swaps] ERC20 custom approvals not human readable
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
Describe the bug
Approvals in swaps are in scientific notation instead of decimal format.
Steps to reproduce (REQUIRED)
Steps to reproduce the behavior, libraries used with version number, and/or any setup information to easily reproduce:
- Perform a swap, and edit the spend allowance for a token (the
approvemethod) - Try changing the allowance
Expected behavior
A clear description of what you expected to happen.
The output for the user should not be in scientific notation, instead it should be represented in a similar fashion that the token is represented in the assets tab.
Screenshots
If applicable, add screenshots to help explain your problem.

Browser details (please complete the following information):
- OS: [e.g. OS X, Windows] OS X
- Browser: [e.g. Chrome Version 79.0.3945.79 (Official Build) (64-bit), Firefox Browser 71.0 (64-bit)] Firefox
- MetaMask Version: [e.g. 5.0.2 - find it in Settings > About] 10.5.1
Edit 1: updated bug description & removed additional information
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue in the swaps flow: perform a swap, edit the token spend allowance through the approve method, and change the allowance. Trace the UI entry point for editing approvals and compare its formatting with the token display in the assets tab. Done means the allowance is shown in decimal format rather than scientific notation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100