Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 4x 168x 79x 89x 76x 76x 13x 13x | export const bytesToHumanReadable = (bytes: number) => {
if (bytes < 1024) {
return `${bytes} bytes`;
}
if (bytes < 1024 * 1024) {
const kb = bytes / 1024;
return `${parseFloat(kb.toFixed(2))} KiB`;
}
const mb = bytes / (1024 * 1024);
return `${parseFloat(mb.toFixed(2))} MiB`;
};
|