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

Function formatBytes

apps/vis/web/src/components/shared/SizePreview.tsx:51–55  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

49}
50
51export function formatBytes(n: number): string {
52 if (n < 1024) return `${n}B`;
53 if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)}KB`;
54 return `${(n / 1024 / 1024).toFixed(2)}MB`;
55}

Callers 5

ToolStatsTableFunction · 0.90
ToolRowFunction · 0.90
TaskCardFunction · 0.90
TaskOutputFunction · 0.90
SizePreviewFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected