MCPcopy Create free account
hub / github.com/error311/FileRise / formatBytes

Function formatBytes

public/js/sharedDropView.js:218–225  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

216 }
217
218 function formatBytes(bytes) {
219 const n = Number(bytes || 0);
220 if (!Number.isFinite(n) || n <= 0) return '0 B';
221 if (n < 1024) return n + ' B';
222 if (n < 1048576) return (n / 1024).toFixed(2) + ' KB';
223 if (n < 1073741824) return (n / 1048576).toFixed(2) + ' MB';
224 return (n / 1073741824).toFixed(2) + ' GB';
225 }
226
227 function renderRules() {
228 if (!rulesEl) return;

Callers 1

ensureRowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected