View Single Post
Old 06-05-2016, 08:15 AM   #3
Joanna
Groupie
Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.Joanna understands the mechanisms of the catecholamine pathways.
 
Posts: 199
Karma: 76476
Join Date: Feb 2012
Location: Poland
Device: none
@chaley, thank you for so much your help! GPM does look much less confusing.

So now I am using your template for "Pages read" and a similar one for "Pages left":

Code:
program:
	progress = field('#progress');
	percent = divide(progress, 100);
	pagesread = multiply(field('#pages'), percent);
	test(progress, pagesread, '');
Code:
program:
	progress = field('#progress');
	left = subtract(100, progress);
	percent = divide(left, 100);
	pagesleft = multiply(percent, field('#pages'));
test(progress, pagesleft, '');
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.

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.
Joanna is offline   Reply With Quote