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

Function formatTokens

scripts/session-tokens.js:14–18  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

12const sessionTokens = require('../runtimes/claude-code/adapters/session-tokens');
13
14function formatTokens(n) {
15 if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
16 if (n >= 1_000) return `${(n / 1_000).toFixed(1)}K`;
17 return String(n);
18}
19
20function printSession(label, tokens, cost) {
21 console.log(`\n ${label}`);

Callers 2

printSessionFunction · 0.70
runCliFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected