mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Fix rounding
This commit is contained in:
parent
8c610bea49
commit
473f15abca
@ -150,7 +150,7 @@ export function ThresholdBarGraph({
|
|||||||
|
|
||||||
const getUnitSize = (MB: number) => {
|
const getUnitSize = (MB: number) => {
|
||||||
if (isNaN(MB) || MB < 0) return "Invalid 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`;
|
if (MB < 1048576) return `${(MB / 1024).toFixed(2)} GiB`;
|
||||||
|
|
||||||
return `${(MB / 1048576).toFixed(2)} TiB`;
|
return `${(MB / 1048576).toFixed(2)} TiB`;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user