fix(web): compact notation defaults to 2 fraction digits, not 4 - #10
Open
draevik wants to merge 1 commit into
Open
fix(web): compact notation defaults to 2 fraction digits, not 4#10draevik wants to merge 1 commit into
draevik wants to merge 1 commit into
Conversation
Non-blocking follow-up from review on the market cap overflow fix. formatNumber's default maximumFractionDigits: 4 was carrying into compact notation too, so a value rendered as $12.3457K instead of the cleaner $12.35K. All four current compact-notation call sites (trending-card.tsx, token-card.tsx, hero-ticker.tsx, ranking-table.tsx) share this, so the fix lives in the shared formatNumber function itself rather than being patched per call site -- applies to all of them at once, and any future one. An explicit maximumFractionDigits in the caller's options still wins, since it's spread last. Verified: ran the existing 41-test suite for this file, all pass (nothing regressed). Added 2 new tests covering the new default and the explicit-override case, verified their expected values against the real function output rather than hand-calculation. Typecheck and lint clean.
|
@draevik is attempting to deploy a commit to the Lightchain AI Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Non-blocking follow-up from review on the market cap overflow fix.
formatNumber's defaultmaximumFractionDigits: 4was carrying into compact notation too, so a value rendered as$12.3457Kinstead of the cleaner$12.35K.Changes
All four current compact-notation call sites (
trending-card.tsx,token-card.tsx,hero-ticker.tsx,ranking-table.tsx) share thisformatter, so the fix lives in
formatNumberitself rather than being patched per call site -- applies to all of them at once, andany future one. An explicit
maximumFractionDigitsin the caller's options still wins, since it's spread last.Verification