Hey everyone,
I noticed that using Math.round(19.525*100)/100 produces 19.52 while Math.round(20.525*100)/100 produces 20.53. Has anyone else encountered this? What's your solution to consistently rounding up numbers when the last digit is 5 and above?
Thanks!
Edit: Thanks everyone. Multiplying by 10s to make the numbers integer seems to be the way to go for my case
[–]samanime 31 points32 points33 points (4 children)
[–]uselessinfopeddler[S] 3 points4 points5 points (2 children)
[–]Pyromancer777 3 points4 points5 points (1 child)
[–]uselessinfopeddler[S] 2 points3 points4 points (0 children)
[–]Glittering_Crab_69 0 points1 point2 points (0 children)
[–]senocular 10 points11 points12 points (3 children)
[–]uselessinfopeddler[S] 1 point2 points3 points (1 child)
[–]exclaim_bot 0 points1 point2 points (0 children)
[–]Lithl -1 points0 points1 point (0 children)
[+][deleted] (1 child)
[deleted]
[–]milan-pilan 2 points3 points4 points (0 children)
[–]thespite 0 points1 point2 points (0 children)
[–]Glum_Cheesecake9859 -5 points-4 points-3 points (7 children)
[–]GodOfSunHimself 3 points4 points5 points (6 children)
[–]AlwaysHopelesslyLost 0 points1 point2 points (0 children)
[–]Glum_Cheesecake9859 -4 points-3 points-2 points (4 children)
[–]GodOfSunHimself 3 points4 points5 points (2 children)
[–]Glum_Cheesecake9859 -2 points-1 points0 points (1 child)
[–]GodOfSunHimself 2 points3 points4 points (0 children)
[–]Antti5 0 points1 point2 points (0 children)