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

Function formatBytes

public/js/sharedFolderView.js:629–637  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

627 }
628
629 function formatBytes(bytes) {
630 if (bytes === null || typeof bytes === 'undefined') return '-';
631 const n = Number(bytes);
632 if (!Number.isFinite(n)) return '-';
633 if (n < 1024) return n + ' B';
634 if (n < 1048576) return (n / 1024).toFixed(2) + ' KB';
635 if (n < 1073741824) return (n / 1048576).toFixed(2) + ' MB';
636 return (n / 1073741824).toFixed(2) + ' GB';
637 }
638
639 function formatDate(value) {
640 if (!value) return '-';

Callers 2

renderListFunction · 0.70
renderGalleryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected