fix: évolution en pourcent 0 quand evol=0
parent
4cbc2c15a7
commit
0d8aa0209a
|
@ -78,7 +78,9 @@ function valueWithEvol(
|
||||||
|
|
||||||
function evolPercent(current: number, previous: number | undefined): number {
|
function evolPercent(current: number, previous: number | undefined): number {
|
||||||
if (previous === undefined) return NaN;
|
if (previous === undefined) return NaN;
|
||||||
return (100 * evol(current, previous)) / previous;
|
const evolValue = evol(current, previous);
|
||||||
|
if (evolValue === 0) return 0;
|
||||||
|
return (100 * evolValue) / previous;
|
||||||
}
|
}
|
||||||
|
|
||||||
function evol(current: number, previous: number | undefined): number {
|
function evol(current: number, previous: number | undefined): number {
|
||||||
|
|
Loading…
Reference in New Issue