fix: change in number format to fix loss of precision for very big values#25968
Merged
fix: change in number format to fix loss of precision for very big values#25968
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. |
dbrans
reviewed
Jul 19, 2024
ui/pages/confirmations/components/simulation-details/formatAmount.ts
Outdated
Show resolved
Hide resolved
Collaborator
Builds ready [d5bcd33]
Page Load Metrics (145 ± 159 ms)
Bundle size diffs
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #25968 +/- ##
========================================
Coverage 69.94% 69.94%
========================================
Files 1409 1409
Lines 49795 49802 +7
Branches 13773 13775 +2
========================================
+ Hits 34826 34833 +7
Misses 14969 14969 ☔ View full report in Codecov by Sentry. |
Collaborator
Builds ready [3f21bca]
Page Load Metrics (218 ± 223 ms)
Bundle size diffs
|
dbrans
reviewed
Jul 25, 2024
| // string is valid parameter for format function | ||
| // for some reason it gives TS issue | ||
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/format#number | ||
| amount.toFixed(0) as unknown as number, |
Contributor
There was a problem hiding this comment.
Awesome find!
In that case, we don't need the if (maximumFractionDigits === 0) { above... we can have the same code path for all amounts here.
|
Collaborator
Builds ready [115a1b2]
Page Load Metrics (506 ± 358 ms)
Bundle size diffs
|
7 tasks
matthewwalsh0
approved these changes
Jul 26, 2024
Contributor
|
Cherry-pick to V12.1.0 #26496 |
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
fix loss of precision for very big values in signature simulations
Related issues
Fixes: #25755
Manual testing steps
115792089237316195423570985008687907853269984665640564039457584007913129639935Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist