voting ending fixed

This commit is contained in:
Kalle (Sendou)
2021-03-22 19:19:51 +02:00
parent 9598723795
commit d55aa397f8
2 changed files with 11 additions and 11 deletions

View File

@@ -18,8 +18,11 @@ export const getPercentageFromCounts = (
const otherSum = otherRegionArr[1] * -1 + otherRegionArr[2] * 1;
const otherVoterCount = otherRegionArr.reduce((acc, cur) => acc + cur, 0);
return (
((sameSum / sameVoterCount + otherSum / otherVoterCount + 3) / 6) * 100
return parseFloat(
(
((sameSum / sameVoterCount + otherSum / otherVoterCount + 3) / 6) *
100
).toFixed(1)
);
};