Skip to content

fix: use subscript for price notation#24441

Merged
sahar-fehri merged 8 commits intomainfrom
fix/use-subscript-notation-trending-prices
Jan 16, 2026
Merged

fix: use subscript for price notation#24441
sahar-fehri merged 8 commits intomainfrom
fix/use-subscript-notation-trending-prices

Conversation

@sahar-fehri
Copy link
Copy Markdown
Contributor

@sahar-fehri sahar-fehri commented Jan 12, 2026

Description

This PR improves the price formatting in the Trending Tokens feature by introducing subscript notation for very small token prices (e.g., 0.00000614 → $0.0₆14).
Changes include:

  • New formatPriceWithSubscriptNotation function - Formats prices with subscript notation for values with 4+ leading zeros, making small token prices more readable
  • Zero value handling - Shows "—" (em dash) when price is zero, and also for percentage change when price is zero
  • Market stats dash display - Shows "-" for market cap and volume when values are zero instead of displaying misleading "$0" values

Changelog

CHANGELOG entry: Improved price display for trending tokens with subscript notation for very small values (e.g., $0.0₆14)

Related issues

Fixes: #24327
Fixes: #24326

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Screen.Recording.2026-01-15.at.16.26.55.mov

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

Improves readability of tiny token prices and zero-value stats in Trending Tokens.

  • Adds formatPriceWithSubscriptNotation in Predict/utils/format.ts (with toSubscript) to render very small prices using subscript (e.g., $0.0₅614), returns for zero, otherwise 2–4 decimals
  • Updates TrendingTokenRowItem.tsx to use the new formatter and display instead of percentage change when price is zero
  • Changes formatMarketStats in TrendingTokenRowItem/utils.ts to show - for zero marketCap/volume
  • Updates/extends tests: comprehensive cases for the new price formatting, adjusted expectations for zero stats, and component rendering behaviors

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

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

@sahar-fehri sahar-fehri marked this pull request as ready for review January 15, 2026 15:27
@sahar-fehri sahar-fehri requested a review from a team as a code owner January 15, 2026 15:27
@github-actions github-actions bot added size-M and removed size-S labels Jan 15, 2026
caieu
caieu previously approved these changes Jan 16, 2026
Copy link
Copy Markdown
Contributor

@caieu caieu left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added size-L and removed size-M labels Jan 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

The changes are limited to UI formatting utilities for the Trending tokens feature:

  1. New utility function added: formatPriceWithSubscriptNotation in Predict/utils/format.ts - formats very small prices with subscript notation (e.g., 0.00000614 → $0.0₅614)

  2. TrendingTokenRowItem updated: Now uses the new formatting function and shows dashes for zero values

  3. formatMarketStats updated: Shows dashes instead of $0.00 for zero market cap/volume

Key observations:

  • No E2E tests exist for Trending or Predict features (confirmed by grep search)
  • The existing formatPrice function is NOT modified - only a new function is added
  • The new formatPriceWithSubscriptNotation is only used by TrendingTokenRowItem
  • All changes have comprehensive unit tests included
  • This is purely a UI display formatting change with no impact on core wallet functionality

Since there are no E2E tests for these features and the changes are isolated UI formatting improvements with full unit test coverage, no E2E test tags need to be run.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@caieu caieu left a comment

Choose a reason for hiding this comment

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

LGTM

@sahar-fehri sahar-fehri added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit e2da33b Jan 16, 2026
58 checks passed
@sahar-fehri sahar-fehri deleted the fix/use-subscript-notation-trending-prices branch January 16, 2026 13:47
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 16, 2026
@metamaskbot metamaskbot added release-7.62.0 Issue or pull request that will be included in release 7.62.0 and removed release-7.63.0 Issue or pull request that will be included in release 7.63.0 labels Jan 26, 2026
@metamaskbot
Copy link
Copy Markdown
Collaborator

Missing release label release-7.62.0 on PR. Adding release label release-7.62.0 on PR and removing other release labels(release-7.63.0), as PR was cherry-picked in branch 7.62.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.62.0 Issue or pull request that will be included in release 7.62.0 size-L team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: inconsistent cap & vol data [Bug]: Decimals formatting doesnt support tokens < 0.01

4 participants