myheats

Live heats, scoring and leaderboard for sport events
git clone https://git.in0rdr.ch/myheats.git
Log | Files | Refs | Pull requests | README | LICENSE

commit ec7097f0c139c25e7393bb6e307001ea97396068
parent c6bada8f010b9b38d691efd4348e0691df138b1d
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Thu, 13 Apr 2023 21:03:41 +0200

fix: floating point imprecision in sum

Diffstat:
Msrc/Leaderboard.js | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Leaderboard.js b/src/Leaderboard.js @@ -52,7 +52,7 @@ async function getRatingSummary(heatIds) { i.worstHeat = Math.min(...i.heats.map(h => h.summary)) // sum up all totals across heats - i.sum = i.heats.map(h => h.summary).reduce((a, b) => a + b, 0) + i.sum = i.heats.map(h => h.summary).reduce((a, b) => a + b, 0).toFixed(1) } startListWithRatings.push(i)