# Posts Read Rounding Error

**URL:** https://meta.discourse.org/t/posts-read-rounding-error/81949
**Category:** Bug
**Created:** [March 2, 2018, 6:47am UTC](https://meta.discourse.org/t/posts-read-rounding-error/81949 "2018-03-02T06:47:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JonnyGamer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonnygamer/32/73086_2.png) [@JonnyGamer](https://meta.discourse.org/u/JonnyGamer)
#### Post date: [March 2, 2018, 6:47am UTC](https://meta.discourse.org/t/posts-read-rounding-error/81949/1 "2018-03-02T06:47:15Z")

</div>

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)

 ![IMG_3437](https://global.discourse-cdn.com/meta/original/3X/b/5/b5c431ab83e4af38c09b7bc4546a721eea1241fc.jpg)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 2, 2018, 7:00am UTC](https://meta.discourse.org/t/posts-read-rounding-error/81949/2 "2018-03-02T07:00:38Z")

</div>

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

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [March 2, 2018, 10:01am UTC](https://meta.discourse.org/t/posts-read-rounding-error/81949/4 "2018-03-02T10:01:30Z")

</div>

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](https://github.com/discourse/discourse/commit/6d4ff05cf029c0a0eeffd55ef681255495a91c1e)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [March 2, 2018, 10:01am UTC](https://meta.discourse.org/t/posts-read-rounding-error/81949/5 "2018-03-02T10:01:36Z")

</div>


