feat: wrapup wow — animated counters, scroll-reveal, fun facts, component split, budget formatting
Some checks failed
CI / Check / Test (push) Failing after 6m25s
Some checks failed
CI / Check / Test (push) Failing after 6m25s
This commit is contained in:
6
spa/src/lib/format.ts
Normal file
6
spa/src/lib/format.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function fmtUsd(n: number): string {
|
||||
if (n >= 1_000_000_000) return `$${(n / 1_000_000_000).toFixed(n % 1_000_000_000 === 0 ? 0 : 1)}B`
|
||||
if (n >= 1_000_000) return `$${Math.round(n / 1_000_000)}M`
|
||||
if (n >= 1_000) return `$${Math.round(n / 1_000)}K`
|
||||
return `$${n}`
|
||||
}
|
||||
Reference in New Issue
Block a user