Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number parsing #2093

Open
estebanmino opened this issue Jan 5, 2021 · 6 comments
Open

Number parsing #2093

estebanmino opened this issue Jan 5, 2021 · 6 comments
Assignees
Labels
needs-design Feature that requires UI/UX design

Comments

@estebanmino
Copy link
Contributor

Custom implementation for renderFromTokenMinimalUnit, no less than 0.0001

opts with

  • decimals to show
  • significant decimals

Currencies are with 5 decimals by default instead of showing the specific currency decimal numbers
Don't show decimals if no decimals

@omnat
Copy link
Contributor

omnat commented Jan 27, 2021

@wachunei related to the issues you found. let's make improve those unit tests so we catch similar number format errors everywhere in the app

@omnat omnat added copy/content needed needs-design Feature that requires UI/UX design labels Jan 28, 2021
@omnat
Copy link
Contributor

omnat commented Jan 28, 2021

Sync with Mark and Rachel on this: on which library to use for rendering numbers and internationalization standard we'd use cross-product

@omnat
Copy link
Contributor

omnat commented Feb 3, 2021

Notes from meeting:

Let's find a standardized way of dealing with this

  1. Number processing:
    - Turn all number inputs into a string before passing them through Big Number
    - Use Ethers BigNumber library consistently for manipulating the strings to number
  2. Rendering:
    - Internationalization library for FIAT (between different currencies): some conversation here https://app.zenhub.com/workspaces/metamask-mobile-5f984938ddc0e4001d4b79cb/issues/metamask/metamask-mobile/2137
    - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
    - Rendering crypto values:
    - Extension shows accurate values in decimal (no rounding), only exception is trailing zeroes
    - Design guidelines so far on this: https://www.figma.com/file/aWgwMrzdAuv9VuPdtst64uuw/MetaMask-Design-System?node-id=1628%3A1871

@omnat
Copy link
Contributor

omnat commented Feb 16, 2021

Next steps: Write a proposal on how to parse numbers reliably and consistently.
cc @andrepimenta @wachunei

@mobularay
Copy link
Contributor

mobularay commented May 25, 2021

With @andrepimenta moving to the Core team, this ticket should wait until the Core team has an agreed way of implementing number parsing.

Needs to split work into:

  1. (Technical) Research / Proposal
  2. UI/UX Design work
  3. Implementation work

@legobeat
Copy link
Contributor

Related: #12043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-design Feature that requires UI/UX design
Projects
None yet
Development

No branches or pull requests

6 participants