View Single Post
Old 10-10-2024, 03:23 PM   #580
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,321
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by ownedbycats View Post
I'm currently reading a book that's 446 pages long. While running the chain with a current_page of 190, this converted it to 43%.

However, when I look in Reading Goal, it shows 'pages' as 192. I often get minor differences like this for physical books - just 2 or 3 pages off. What causes it?
The difference is because you are rounding the result in your template.

190 / 446 = 42.6%, which was rounded to 43%
0,43 * 446 = 191,78 ≅ 192

Remove the round() bit from your template and the values should match.

EDIT:
Actually, the plugin does the same rounding when calculating the read pages, so it won't matter if you remove the rounding from your template. This happens because I chose to work with integers for the percentage read (as you also did).

Last edited by thiago.eec; 10-10-2024 at 04:21 PM.
thiago.eec is offline   Reply With Quote