MCPcopy Create free account
hub / github.com/Coneja-Chibi/CarrotKernel / formatFileSize

Function formatFileSize

index.js:4827–4833  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

4825}
4826function formatFileSize(bytes) {
4827 if (bytes === 0) return '0 B';
4828 const k = 1024;
4829 const sizes = ['B', 'KB', 'MB', 'GB'];
4830 const i = Math.floor(Math.log(bytes) / Math.log(k));
4831 return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
4832}
4833
4834// Remove old pack manager functions and replace with browser navigation functions
4835async function populatePackGrids(packManager) {
4836 const themeContainer = document.getElementById('carrot-theme-packs');

Callers 2

generateFileListFunction · 0.85
index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected