MCPcopy Create free account
hub / github.com/SethGammon/Citadel / formatTokens

Function formatTokens

hooks_src/cost-tracker.js:98–102  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

96// ── Helpers ──────────────────────────────────────────────────────────────────
97
98function formatTokens(n) {
99 if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
100 if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`;
101 return String(n);
102}
103
104/**
105 * Check if the active campaign has a budget and whether we're near it.

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected