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

Function formatFileSize

tools/common/taskbarPreview.js:357–361  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

355
356 // Format the file size
357 function formatFileSize(bytes) {
358 if (bytes < 1024) return bytes + ' B'
359 if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB'
360 return (bytes / (1024 * 1024)).toFixed(1) + ' MB'
361 }
362
363 // Batch download as ZIP
364 async function downloadAllAsZip() {

Callers 1

renderPreviewItemFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected