-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: change in number format to fix loss of precision for very big values #25968
Conversation
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. |
ui/pages/confirmations/components/simulation-details/formatAmount.ts
Outdated
Show resolved
Hide resolved
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. |
Builds ready [3f21bca]
Page Load Metrics (218 ± 223 ms)
Bundle size diffs
|
// 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Quality Gate passedIssues Measures |
Builds ready [115a1b2]
Page Load Metrics (506 ± 358 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great fix!
Cherry-pick to V12.1.0 #26496 |
Description
fix loss of precision for very big values in signature simulations
Related issues
Fixes: #25755
Manual testing steps
115792089237316195423570985008687907853269984665640564039457584007913129639935
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist