mirror of
https://github.com/csehviktor/status-monitor.git
synced 2026-04-29 00:27:35 +02:00
fix undefined values
This commit is contained in:
@@ -63,7 +63,7 @@ export function calcPercentage(
|
||||
value: number | undefined,
|
||||
total: number | undefined,
|
||||
): number {
|
||||
if (value === undefined || total === undefined) return 0;
|
||||
if (!value || !total) return 0;
|
||||
return (value / total) * 100;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user