Posts Read Rounding Error

(Jonathan) #1

The following shows a simple rounding error

When a user has read 1 million posts, discouse displays, “1.0 M posts read”

But when 999,500 - 999,999 posts have been read, discourse rounds up and displays 1,000K instead of 1.0M

I must’ve been insanely lucky to observe this since it’s in a range of 500 posts:
(5th row, 6th collumn)

(Jeff Atwood) #2

Heh, that’s a bug for @techapj :wink:

(Joffrey Jaffeux) #4

Didn’t know how we format numbers so used this issue to read the code about it. This should fix it:

(Joffrey Jaffeux) #5