datasektionen / betting

Bettingsystem för SM
https://betting.datasektionen.se
0 stars 2 forks source link

Fix (potentially rounding) issue when ending bets #2

Open Herkarl opened 1 year ago

Herkarl commented 1 year ago

2022-10-11-15:45:32

In the above image, both users that are 1 minutes and 2 minutes away from the ending time are shown. Only the one with 1 minute away should be shown as a winner.

(note that the bet was ended ~6 minutes too late, and it would have resulted in another winner if done correctly, so I am not biased in this issue)

Alternative fix: finish work on betting-hd

foodelevator commented 1 year ago

I think this is because the SM ended somewhere between 23:35 and 23:36. I think the distance gets calculated in minutes, rounded down, so both those that bet on 23:34 and 23:37 would be one minute (and some amount of seconds) from the correct answer.