MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / formatAbbreviatedNumber

Function formatAbbreviatedNumber

examples/worker-rendering/main.ts:198–203  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

196}
197
198function formatAbbreviatedNumber(n: number): string {
199 if (n < 1000) return n.toString();
200 if (n < 1_000_000) return `${(n / 1_000).toFixed(1)}K`;
201 if (n < 1_000_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
202 return `${(n / 1_000_000_000).toFixed(2)}B`;
203}
204
205// ============================================================================
206// Total Points Display

Callers 1

updateTotalPointsDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected