|
@@ -6,7 +6,7 @@ export const sum = (a: number[]) =>
|
|
|
a.reduce((s: number, i: number) => s + i, 0);
|
|
|
|
|
|
export const getPercent = (value1: number, value2: number): number => {
|
|
|
- if (value1 === 0) return value2 > 0 ? 100 : 0;
|
|
|
+ if (value1 === 0) return value2 > 0 ? Infinity : 0;
|
|
|
return Number(((value2 * 100) / value1 - 100).toFixed(2));
|
|
|
};
|
|
|
|