Posts Read Rounding Error

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)

5 Likes

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

3 Likes

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

https://github.com/discourse/discourse/commit/6d4ff05cf029c0a0eeffd55ef681255495a91c1e

11 Likes