MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / bytes

Function bytes

static/js/utils.js:635–641  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

633 },
634
635 bytes(bytes) {
636 if (bytes === 0) return '0 B';
637 const k = 1024;
638 const sizes = ['B', 'KB', 'MB', 'GB'];
639 const i = Math.floor(Math.log(bytes) / Math.log(k));
640 return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
641 },
642
643 number(num) {
644 if (num === null || num === undefined) return '-';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected