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

Handle with token with large number #465

Merged
merged 3 commits into from
Sep 29, 2023
Merged

Conversation

ryutamago
Copy link
Contributor

@ryutamago ryutamago commented Sep 29, 2023

Handle token with large number

There was a bug where the app didn't handle sending token with large number (1e21+)
This was due to how the BigNumber uses scientific notation for stringifying large number, we need to use toFixed method instead of toString method to avoid the scientific notation.

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Steps to reproduce

log in with a fake account tz1Y8cACwiwQYwLNzzHnBvLQBendT6DUR3Rn and try and send over 1000 of PLY token. This used to fail due to the string conversion with scientific notation.

Screenshots

Large number:

Before Now
https://github.com/trilitech/umami-v2/assets/128799322/e0607670-25fd-4d9b-a36c-9eec25866cb1 https://github.com/trilitech/umami-v2/assets/128799322/4d6f8301-a6db-4057-a22f-466f31fff66c

I also checked with small number and that worked fine:

Screen.Recording.2023-09-29.at.16.47.50.mov

Checklist

  • Tests that prove my fix is effective or that my feature works have been added
  • Documentation has been added (if appropriate)
  • Screenshots are added (if any UI changes have been made)
  • All TODOs have a corresponding task created (and the link is attached to it)

@ryutamago ryutamago force-pushed the handle-token-with-large-number branch from 484d8dc to 646979c Compare September 29, 2023 09:38
@ryutamago ryutamago force-pushed the handle-token-with-large-number branch from 646979c to f5ccff1 Compare September 29, 2023 09:41
@ryutamago ryutamago merged commit 54d90f2 into main Sep 29, 2023
@ryutamago ryutamago deleted the handle-token-with-large-number branch September 29, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants