website icon indicating copy to clipboard operation
website copied to clipboard

Fix rounding error in player count

Open bluelhf opened this issue 2 years ago • 4 comments

This PR updates index.tsx to use Math.floor() instead of Math.round() when displaying bStats player data. This ensures values like 30,600 do not get displayed as 31K+

P.S. Love the new website :)

bluelhf avatar Mar 20 '23 08:03 bluelhf

I think this was done intentionally bstats is only the lower limit on player count, we dont know the actual (but know its much higher), so rounding up is fine

MiniDigger avatar Jul 19 '23 10:07 MiniDigger

It’s still incorrect though. Let’s say that bstats reports 10,600 players and the true amount is 10,800. Rounding to 11k+ is wrong and this PR would fix it.

I know you said that we can assume the real amount is much higher but this isn’t always the case.

olijeffers0n avatar Jul 19 '23 10:07 olijeffers0n

conservative estimates say that 50%+ of all paper servers have bstats disabled (many hosts disable it for some dum reason).

MiniDigger avatar Jul 19 '23 13:07 MiniDigger

I think this was done intentionally bstats is only the lower limit on player count, we dont know the actual (but know its much higher), so rounding up is fine

Looks to be intentional: 20385f34f7e5f6619a0ca213f3159bea57579754 (see commit message). Still, it feels wrong to report a lower bound that could be higher than the actual value, however slim that possibility may be. What do you think?

bluelhf avatar Jul 20 '23 16:07 bluelhf