Skip to content

fix(ramp): Correct ramp v2 order detail's crypto amount formatting#27469

Open
imyugioh wants to merge 2 commits intoMetaMask:mainfrom
imyugioh:fix/ramp-order-content-decimal-formatting
Open

fix(ramp): Correct ramp v2 order detail's crypto amount formatting#27469
imyugioh wants to merge 2 commits intoMetaMask:mainfrom
imyugioh:fix/ramp-order-content-decimal-formatting

Conversation

@imyugioh
Copy link
Contributor

@imyugioh imyugioh commented Mar 13, 2026

Description

Fixes excessive decimal places on the Order Details screen for ramp purchases. When buying crypto (e.g. ETH via Mercuryo), the cryptoAmount was displayed raw with up to 17 decimal digits (0.01588973776561068), breaking the layout.

Now the amount is formatted consistently with the home screen:

  • Normal amounts are capped at 5 decimal places using formatWithThreshold (e.g. 0.01589 ETH)
  • Very small amounts (< 0.0001) use subscript notation via formatSubscriptNotation (e.g. 0.0₅4567 BTC)
  • Missing amounts show ...

Changelog

CHANGELOG entry: Fixed Order Details screen displaying excessive decimal places for crypto amounts after ramp purchases.

Related issues

Refs:

Manual testing steps

Feature: Order Details crypto amount formatting

  Scenario: Normal crypto amount is truncated to 5 decimal places
    Given the user has completed a buy order (e.g. ETH via Mercuryo)
    And the order cryptoAmount has many decimal places (e.g. 0.01588973776561068)

    When the Order Details screen is displayed
    Then the crypto amount is shown as "0.01589 ETH"
    And the layout is not broken by excessive decimals

  Scenario: Very small crypto amount uses subscript notation
    Given the user has completed a buy order with a very small amount (e.g. $5 of BTC)
    And the order cryptoAmount is less than 0.0001 (e.g. 0.00000456789)

    When the Order Details screen is displayed
    Then the crypto amount is shown with subscript notation (e.g. "0.0₅4567 BTC")

Screenshots/Recordings

Before

Screenshot 2026-03-13 180811

After

Screenshot 2026-03-13 175207 Screenshot 2026-03-13 175321

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk UI-only change that adjusts number formatting on the ramp Order Details screen and adds unit tests for edge cases (tiny, long-decimal, missing, and zero amounts).

Overview
Fixes ramp v2 Order Details to format cryptoAmount instead of rendering the raw number, preventing long decimals from breaking layout.

Amounts now prefer formatSubscriptNotation for very small values, otherwise use formatWithThreshold with a 5-decimal cap and current I18n.locale; missing amounts render as .... Adds tests covering long decimals, subscript formatting, missing values, and zero.

Written by Cursor Bugbot for commit 188a754. This will update automatically on new commits. Configure here.

@github-actions
Copy link
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.

@imyugioh imyugioh marked this pull request as ready for review March 13, 2026 23:12
@imyugioh imyugioh requested a review from a team as a code owner March 13, 2026 23:12
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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.

1 participant