MCPcopy Create free account
hub / github.com/apache/maka / formatTokenCount

Function formatTokenCount

packages/cli/src/pi-transcript.ts:1465–1469  ·  view source on GitHub ↗
(tokens: number)

Source from the content-addressed store, hash-verified

1463}
1464
1465function formatTokenCount(tokens: number): string {
1466 if (tokens >= 1_000_000) return `${(tokens / 1_000_000).toFixed(1)}M`;
1467 if (tokens >= 1_000) return `${Math.round(tokens / 1_000)}k`;
1468 return String(tokens);
1469}
1470
1471function formatCost(costUsd: number): string {
1472 if (costUsd < 0.01) return '<0.01';

Callers 1

renderMakaPiStatusLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected