Skip to content

feat(token-amount): add compact prop for large totals (FlowwStar/FlowStar#383)#392

Open
jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:feat/issue-383-token-compact
Open

feat(token-amount): add compact prop for large totals (FlowwStar/FlowStar#383)#392
jdjioe5-cpu wants to merge 1 commit into
FlowwStar:mainfrom
jdjioe5-cpu:feat/issue-383-token-compact

Conversation

@jdjioe5-cpu

Copy link
Copy Markdown

Closes #383. Adds optional compact?: boolean prop. When true uses formatCompactAmount(amount, decimals) (Intl.NumberFormat 'compact' notation). Default false preserves existing render.

…r#383)

Closes FlowwStar#383.

Adds an optional `compact?: boolean` prop to TokenAmount. When true, the
amount is rendered via `formatCompactAmount(amount, decimals)` from
`lib/stream-utils.ts` (Intl.NumberFormat 'compact' notation, e.g. 1.2K)
instead of the default full-precision `formatTokenAmount`.

Default `compact = false` preserves the existing render path so callers
without the prop are visually unchanged. Symbol rendering, className
plumbing, and showSymbol behavior are unchanged.
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.

good first issue: add a compact prop to TokenAmount for large totals

1 participant