From 1c90f62ea51bd9efb8d57434b9b8abbe6eaeaa91 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Sun, 28 Apr 2024 21:00:57 -0700 Subject: [PATCH] Fix rounding (#11147) --- web/src/components/graph/SystemGraph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/graph/SystemGraph.tsx b/web/src/components/graph/SystemGraph.tsx index e96ce8235..fe1204b29 100644 --- a/web/src/components/graph/SystemGraph.tsx +++ b/web/src/components/graph/SystemGraph.tsx @@ -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`;