Quote:
Originally Posted by davidfor
The point of using a template is that you can add code. My examples were just that, examples. Simple things that I used to test. I understand enough about the calibre templates, that I didn't need to do more.
As to what is wrong, you need to tell us. There is an error the template for the Lower estimate, but, I don't know if that is the actual issue or not. This has an extra parenthesis in it. If you used the Template editor it would show an error and try to tell you where it is. But, the correct template should be:
Code:
if ($$#words > 6000) then round($$#words / 12000) - 1 else 0 fi
Looking at these, I don't know what you are trying to do. The value for the estimates is supposed to be minutes. Which the device displays a hours. I am pretty sure that zero and one will be displayed as zero by the device or not display anything.
|
I took 7 screenshots.
On the first 3,i'm using the following templates:
program: round($$#words / 12000 - 1)
program: round($$#words / 12000)
The results for reading time on those 3 screenshots are correct. They match the data on the sites and are realistic.
On the next 4 screenshots,i'm using the following templates:
program:if ($$#words > 6000) then round(($$#words / 12000) - 1) else 0 fi
program: if ($$#words > 6000) then round($$#words / 12000) else 1 fi
Here, the results are very contradictory - some are OK, others are totally wrong. And I can't understand why.
By the way, the values of the estimates sent to Kobo are in hours, not minutes. Judging by all the screenshots and results, the data being sent to Kobo, is directly in hours. That's why in the templates, i'm experimenting with 1 and 0.
Cheers!