mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
check if isNaN
This commit is contained in:
parent
dee641a2be
commit
c69e1b26bc
@ -23,6 +23,7 @@ export default function Storage() {
|
||||
}
|
||||
|
||||
const getUnitSize = (MB) => {
|
||||
if (isNaN(MB) || MB < 0) return 'Invalid number';
|
||||
if (MB < 1024) return `${MB} MB`;
|
||||
|
||||
return `${(MB / 1024).toFixed(2)} GB`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user