MCPcopy Create free account
hub / github.com/MemeTray/MemeTray / formatFileSize

Function formatFileSize

tools/all-in-one/script.js:1161–1165  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

1159
1160// Format a file size value
1161function formatFileSize(bytes) {
1162 if (bytes < 1024) return bytes + ' B';
1163 if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB';
1164 return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
1165}
1166
1167// Initialize the application
1168if (document.readyState === 'loading') {

Callers 2

displayResultsFunction · 0.90
createResultItemFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected