-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: number formatting on swap + send tx detail #26029
fix: number formatting on swap + send tx detail #26029
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. |
7a10056
to
c97c4b3
Compare
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.
PR Summary
(updates since last review)
This pull request addresses the issue of scientific notation in swap and send transaction details for token amounts less than 1 with six or more leading zeroes.
shared/lib/transaction-controller-utils.test.js
: Enhanced precision handling for token amounts in swap transactions, ensuringgetSwapsTokensReceivedFromTxMeta
respects precision arguments.ui/pages/swaps/swaps.util.ts
: UpdatedformatSwapsValueForDisplay
to handle small values without scientific notation.ui/components/app/transaction-breakdown/transaction-breakdown.test.js
: Added test cases to ensureTransactionBreakdown
correctly renders small token amounts without scientific notation.
These changes ensure accurate rendering of transaction details, especially for small token amounts.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
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.
PR Summary
(updates since last review)
This pull request addresses the issue of scientific notation in swap and send transaction details for token amounts less than 1 with six or more leading zeroes.
shared/lib/transaction-controller-utils.test.js
: Enhanced precision handling for token amounts in swap transactions, ensuringgetSwapsTokensReceivedFromTxMeta
respects precision arguments.ui/pages/swaps/swaps.util.ts
: UpdatedformatSwapsValueForDisplay
to handle small values without scientific notation.ui/components/app/transaction-breakdown/transaction-breakdown.test.js
: Added test cases to ensureTransactionBreakdown
correctly renders small token amounts without scientific notation.
These changes ensure accurate rendering of transaction details, especially for small token amounts.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Quality Gate passedIssues Measures |
Builds ready [5b0eb3d]
Page Load Metrics (163 ± 196 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #26029 +/- ##
========================================
Coverage 69.67% 69.67%
========================================
Files 1405 1405
Lines 49728 49733 +5
Branches 13748 13751 +3
========================================
+ Hits 34646 34651 +5
Misses 15082 15082 ☔ View full report in Codecov by Sentry. |
Description
Fixes an issue when rendering details for a swap + send transaction.
Token amounts less than 1 with >= 6 leading zeroes were formatted in scientific notation.
toString
andtoPrecision
both render scientific in that case, so this PR usestoFixed
instead.Related issues
Fixes: #25876
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist