fix: Reduce usage of scientific notation#27992
Merged
pedronfigueiredo merged 2 commits intodevelopfrom Oct 28, 2024
Merged
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
6464543 to
2394961
Compare
Collaborator
Builds ready [2394961]
Page Load Metrics (1866 ± 60 ms)
Bundle size diffs
|
2394961 to
8dd6ae4
Compare
Collaborator
Builds ready [8dd6ae4]
Page Load Metrics (1887 ± 100 ms)
|
matthewwalsh0
requested changes
Oct 24, 2024
ui/pages/confirmations/components/confirm/info/hooks/use-token-values.ts
Outdated
Show resolved
Hide resolved
781e0d3 to
f42b721
Compare
f42b721 to
c805139
Compare
jpuri
reviewed
Oct 24, 2024
|
|
||
| // keep in scientific notation | ||
| return num.toString(); | ||
| } |
Contributor
There was a problem hiding this comment.
Will be nice to extract this to a util.
Contributor
Author
There was a problem hiding this comment.
I extracted the logic into a contained function but since this function is only used on this hook I think it makes sense for it to live on the same file for now.
Collaborator
Builds ready [c805139]
Page Load Metrics (2123 ± 112 ms)
Bundle size diffs
|
jpuri
approved these changes
Oct 25, 2024
matthewwalsh0
approved these changes
Oct 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the decimals rounding strategy outlined in this document.
When the transfer value is rounded, a tooltip is shown with the full value without rounding. If the number has up to 18 decimal places, it is shown in a user readable format, without rounding. If the number has more than 18 decimal places, the tooltip defaults to showing the scientific notation format. This scenario is unlikely, and only possible through dApp API initiated transfers.
Includes unit tests.
Fixes: #27971
Related issues
Fixes: #27971
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist