feat(deck): format millions as $X.XXMM in fmtUsd
The raise total now shows $1.85MM instead of $1,850k on the raise and ask slides; sub-million figures (category subtotals) stay in $k. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
847f08a975
commit
c645ca1e5f
1 changed files with 8 additions and 5 deletions
|
|
@ -384,11 +384,14 @@ export const roadmap = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
/** Formatting helpers used across slides. */
|
/** Formatting helpers used across slides. Millions render as $X.XXMM. */
|
||||||
export const fmtUsd = (n: number) =>
|
export const fmtUsd = (n: number) => {
|
||||||
n >= 1000
|
if (n >= 1_000_000)
|
||||||
? `$${(n / 1000).toLocaleString('en-US', { maximumFractionDigits: n % 1000 === 0 ? 0 : 1 })}k`
|
return `$${(n / 1_000_000).toLocaleString('en-US', { maximumFractionDigits: 2 })}MM`
|
||||||
: `$${n.toLocaleString('en-US')}`
|
if (n >= 1000)
|
||||||
|
return `$${(n / 1000).toLocaleString('en-US', { maximumFractionDigits: n % 1000 === 0 ? 0 : 1 })}k`
|
||||||
|
return `$${n.toLocaleString('en-US')}`
|
||||||
|
}
|
||||||
|
|
||||||
export const fmtUsdFull = (n: number) => `$${n.toLocaleString('en-US')}`
|
export const fmtUsdFull = (n: number) => `$${n.toLocaleString('en-US')}`
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue