Something went wrong. Try again.
A self-hosted web platform for applications & services with design based on Google's Material 3 Expressive. (Work In Progress)
Something went wrong. Try again.
12345export default function humanReadableSize(sizeBytes: number) { const i = sizeBytes === 0 ? 0 : Math.floor(Math.log(sizeBytes) / Math.log(1024)); return `${+(sizeBytes / 1024 ** i).toFixed(2)} ${["B", "kB", "MB", "GB", "TB"][i]}`;}