MCPcopy Create free account
hub / github.com/anomalyco/models.dev / formatNumber

Function formatNumber

packages/core/script/generate-friendli.ts:91–97  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

89}
90
91function formatNumber(n: number): string {
92 if (n >= 1000) {
93 // Format with underscores for readability (e.g., 131_072)
94 return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "_");
95 }
96 return n.toString();
97}
98
99function timestampToDate(timestamp: number): string {
100 const date = new Date(timestamp * 1000);

Callers 2

formatTomlFunction · 0.70
formatValueFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected