View Single Post
Old 05-08-2022, 10:19 AM   #463
Svens
Enthusiast
Svens began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Apr 2019
Device: Кіndlе5,NGL,PB650, KPW3,KPW4,KPW5, Kobo Aura One
Quote:
Originally Posted by davidfor View Post
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!
Attached Thumbnails
Click image for larger version

Name:	screen_001.png
Views:	297
Size:	237.4 KB
ID:	193726   Click image for larger version

Name:	screen_002.png
Views:	272
Size:	262.8 KB
ID:	193727   Click image for larger version

Name:	screen_003.png
Views:	272
Size:	143.8 KB
ID:	193728   Click image for larger version

Name:	screen_004.png
Views:	267
Size:	249.1 KB
ID:	193729   Click image for larger version

Name:	screen_005.png
Views:	264
Size:	150.2 KB
ID:	193730   Click image for larger version

Name:	screen_006.png
Views:	271
Size:	268.9 KB
ID:	193731   Click image for larger version

Name:	screen_007.png
Views:	261
Size:	267.9 KB
ID:	193732  

Last edited by Svens; 05-09-2022 at 03:28 AM.
Svens is offline   Reply With Quote