Skip to content

[#960] Price subscript notation for small USD values#967

Merged
realproject7 merged 2 commits intomainfrom
task/960-price-subscript-notation
Apr 23, 2026
Merged

[#960] Price subscript notation for small USD values#967
realproject7 merged 2 commits intomainfrom
task/960-price-subscript-notation

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Adds shared formatSubscriptPrice() utility in lib/format.ts that renders small decimals as $0.0₄6262 (subscript-zero notation, matching Mint Club style)
  • Replaces toExponential() calls in PriceChart.tsx (formatUsdPrice and formatReservePrice) with subscript notation
  • Updates formatUsdTokenPrice() in lib/usd-price.ts to use the same shared formatter

Fixes #960

Test plan

  • Verify price chart Y-axis labels show subscript notation for small values
  • Verify "Current price" text uses subscript notation
  • Verify TokenPriceBox displays subscript notation for small USD prices
  • Confirm no scientific notation appears anywhere in the UI

🤖 Generated with Claude Code

…ll USD prices

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 23, 2026 10:11pm

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The PR is close, but the new shared subscript formatter breaks for prices with 10 or more leading zeros after the decimal. In those cases it emits non-digit Unicode characters instead of valid subscript digits, so the display no longer matches the requested Mint Club-style format.

Findings

  • [high] formatSubscriptPrice() only supports a single subscript digit. String.fromCharCode(0x2080 + leadingZeros) works for 0-9, but for 10+ leading zeros it produces unrelated characters (, , , etc.). Example: 0.0000000000601 renders as $0.0₊6010 instead of a valid multi-digit subscript count. The repo already has a correct multi-digit mapping pattern in src/hooks/useTokenInfo.ts.
    • File: lib/format.ts:47
    • Suggestion: Convert leadingZeros to a string and map each digit to its subscript equivalent before joining, rather than deriving a single code point.

Decision

Requesting changes because this is a user-visible formatting bug in the new shared helper and would still violate the acceptance criteria for sufficiently small USD values.

…= 10

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The re-review addresses the blocking formatter bug. Multi-digit leading-zero counts now render as proper digit-by-digit subscripts, so the shared helper matches the intended Mint Club-style format for very small USD values.

Findings

  • No blocking findings.

Decision

Approving because the previous correctness issue in lib/format.ts is fixed and the change now satisfies the requested subscript-zero formatting behavior across the touched USD displays. CI checks were still pending at review time.

@realproject7 realproject7 merged commit 1b3cc1c into main Apr 23, 2026
4 checks passed
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.

[Bug] Price chart shows scientific notation (e.g. $6.01e-5) instead of readable USD

2 participants