Fix rounding (#11147)

This commit is contained in:
Sean Kelly 2024-04-28 21:00:57 -07:00 committed by GitHub
parent acf37f9920
commit 1c90f62ea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,7 +150,7 @@ export function ThresholdBarGraph({
const getUnitSize = (MB: number) => {
if (isNaN(MB) || MB < 0) return "Invalid number";
if (MB < 1024) return `${MB} MiB`;
if (MB < 1024) return `${MB.toFixed(2)} MiB`;
if (MB < 1048576) return `${(MB / 1024).toFixed(2)} GiB`;
return `${(MB / 1048576).toFixed(2)} TiB`;