webui/cosmetics: round collection size to %.2f

This commit is contained in:
Peter Bieringer
2026-03-14 07:24:24 +01:00
parent 119c3361ad
commit ba7baab79f

View File

@@ -106,5 +106,5 @@ export function bytesToHumanReadable(bytes) {
const units = ['b', 'kb', 'mb', 'gb', 'tb'];
let i = bytes == 0 ? 0 : Math.floor(Math.log(bytes) / Math.log(1024));
i = Math.min(i, units.length - 1);
return (bytes / Math.pow(1024, i)) + ' ' + units[i];
}
return Math.round((bytes / Math.pow(1024, i)) * 100) / 100 + ' ' + units[i];
}