Uniswap / Uniswap/interface

Issue with tokens using big numbers

Open
#4,933 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Steps to Reproduce

  1. Go to https://app.uniswap.org/#/swap?theme=dark&inputCurrency=eth&outputCurrency=0xB8235B60471396211A2f22EcbB9e5778c7fcC4f5
  2. Set "0.1" in ETH
  3. You will see "8.979717e+9" when you should see "8979710000"
  4. Not only "8.979717e+9" cannot be understood by anyone not dealing with scientific representation of numbers, the input containing "8.979717e+9" cannot be edited or deleted either, making it impossible to round the number to the next decimals (sometimes needed for tax tokens)

Expected Behavior
You will see "8.979717e+9" in the output amount when you should see "8979710000"
@uniswap/widgets also upgraded to this recently making it impossible to use regular numbers on the widget prior 2.1.5-something

Additional Context

Also happening with $SHIB for instance:
Screenshot 2022-10-16 at 23 02 12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the swap output amount in the interface reached from the provided reproduction URL, then review the related @uniswap/widgets behavior and version note. The fix is done when large token amounts display as regular decimal strings rather than scientific notation and the resulting input remains editable and deletable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.