MCPcopy Create free account
hub / github.com/TQZHR/grok2api / formatSize

Function formatSize

app/static/cache/cache.js:713–720  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

711}
712
713function formatSize(bytes) {
714 if (bytes === 0 || bytes === null || bytes === undefined) return '-';
715 const kb = 1024;
716 const mb = kb * 1024;
717 if (bytes >= mb) return `${(bytes / mb).toFixed(2)} MB`;
718 if (bytes >= kb) return `${(bytes / kb).toFixed(1)} KB`;
719 return `${bytes} B`;
720}
721
722async function showCacheSection(type) {
723 ensureUI();

Callers 1

renderLocalCacheListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected