[#350] Round token price and supply to readable precision#361
[#350] Round token price and supply to readable precision#361realproject7 merged 1 commit intomainfrom
Conversation
Add shared formatPrice/formatSupply utilities in lib/format.ts. Apply formatting to: story page header (price + supply), reader portfolio (total value, balances, holding values), writer dashboard (price + TVL), and OG metadata description. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. formatPrice/formatSupply utilities are clean with good edge case handling (NaN, zero, tiny values, millions). Applied consistently across story page, reader portfolio, writer dashboard, and OG metadata. TVL correctly uses formatPrice since it's reserve-denominated. Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR matches issue #350 and introduces shared formatting utilities that are applied across the story header, reader portfolio, and writer dashboard without widening scope unnecessarily. I also checked the existing home-card TVL path, which already uses its own compact formatting and does not create a gap in this change.
Findings
- No correctness or design issues found in the submitted diff.
Decision
Approved on code review. lint-and-typecheck was still pending at the time of review, so merge should still wait for required GitHub checks.
Summary
formatPrice()andformatSupply()utilities inlib/format.tsformatPrice:0.017411...→0.0174,12.345...→12.35, tiny values → exponentialformatSupply:379827.26...→379,827, millions →1.2MFixes #350
Files changed
lib/format.ts— new shared formatting utilitiessrc/app/story/[storylineId]/page.tsx— price + supply in header and OG metadatasrc/components/ReaderPortfolio.tsx— total value, balances, holding valuessrc/components/WriterTradingStats.tsx— price + TVLTest plan
next buildpasses0.0174 PL_TESTinstead of0.017411310665880643 PL_TEST379,827 tokensinstead of379827.262608456025243581 tokens🤖 Generated with Claude Code