MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatTokenCount

Function formatTokenCount

apps/kimi-code/src/utils/usage/usage-format.ts:8–13  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

6 */
7
8export function formatTokenCount(n: number): string {
9 if (!Number.isFinite(n) || n < 0) return '0';
10 if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
11 if (n >= 1_000) return `${(n / 1_000).toFixed(1)}k`;
12 return String(Math.round(n));
13}
14
15/**
16 * Build a `[███░░░░░░░]` style bar. Returns a plain-ASCII string with

Callers 8

formatStepDebugTimingFunction · 0.90
buildGoalReportLinesFunction · 0.90
formatStopRowFunction · 0.90
buildSessionUsageSectionFunction · 0.90
buildUsageReportLinesFunction · 0.90
buildStatusReportLinesFunction · 0.90
formatGoalStatsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected