MCPcopy Create free account
hub / github.com/cortexkit/magic-context / formatSize

Function formatSize

packages/cli/src/commands/doctor.ts:166–171  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

164}
165
166function formatSize(bytes: number): string {
167 if (bytes < 1024) return `${bytes} B`;
168 if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
169 if (bytes < 1024 * 1024 * 1024) return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
170 return `${(bytes / 1024 / 1024 / 1024).toFixed(2)} GB`;
171}

Callers 1

runClearFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected