Files
klz-cables.com/.pnpm-store/v10/files/45/ba108dcfc2790f70675480fe54ed17ce1ac23313c32fedbc8b15f2383440016d31887615a720a92bf5c198ec555ceb4cccb64c4f014062d6cca03bc8bb802b
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

22 lines
500 B
Plaintext

export function formatFilesize(bytes, decimals = 0) {
if (bytes === 0) {
return '0 bytes';
}
const k = 1024;
const dm = decimals < 0 ? 0 : decimals;
const sizes = [
' bytes',
'KB',
'MB',
'GB',
'TB',
'PB',
'EB',
'ZB',
'YB'
];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return `${parseFloat((bytes / k ** i).toFixed(dm))}${sizes[i]}`;
}
//# sourceMappingURL=formatFilesize.js.map