View Single Post
Old 06-05-2016, 10:35 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,489
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Joanna View Post
[...]

This works perfectly, with the exception of all books that have 1000 pages or more (regardless of whether #progress is empty or not). For those, I get a template error: invalid literal for float().

This has not worked right in my previous TPM template either. Not sure what the reason is, though.
Ahhh, I should have thought of that. The problem is that the "field()" function gets the data with the default formatting for that column, which in the case of #pages will include a comma between the 100s and 1000s place (2,345 instead of 2345). You should use raw_field() instead, which gets the number without formatting it. EDIT: Alternatively, change the formatting for the pages column to remove the comma.
Quote:
There is also some problem with sorting: I've chosen sorting by numbers in the column dialog but now when I try to sort, nothing seems to happen.
Now this is a mystery. It works fine for me. See the attached screen capture. The column "#myint" is what I used for "#pages" and "#myint2" is "#progress".
Attached Thumbnails
Click image for larger version

Name:	Clipboard02.png
Views:	667
Size:	7.9 KB
ID:	149222  

Last edited by chaley; 06-05-2016 at 10:38 AM.
chaley is offline   Reply With Quote