Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-18-2022, 11:18 PM   #1
Deobulakenyo
Guru
Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.
 
Posts: 705
Karma: 2153490
Join Date: Aug 2021
Location: Stupid Philippines
Device: Kobo Libra 2, Boyue Likebook P78
Question on Subtitle display on Kobo

I am using subtitle on Kobotouch plugin and using

this config in the subtitle:

Code:
program:

int_words = raw_field('#words');

# return wordcount in terms of million, e.g. 1m, 1.2m etc
if int_words ># 995000 then
int_words2 = divide(int_words,1000000);
str_words = strcat(format_number(int_words2, '{0: 2.1f}'), '');
if '0' in str_words then
sf_words = format_number(int_words2, '{0: 2.0f}')
else
sf_words = format_number(int_words2, '{0: 2.1f}')
fi;
word_count = strcat(sf_words, 'm')
# wordcount in terms of thousands, e.g. 120k, 230k etc
elif int_words ># 10000 then
int_words2 = divide(int_words,10000);
sf_words = format_number(int_words2, '{0: 2.0f}');
word_count = strcat(sf_words, '0k')
elif int_words ># 1 then
int_words2 = divide(int_words,1000);
sf_words = format_number(int_words2, '{0: 2.0f}');
word_count = strcat(sf_words, 'k')
fi;

subtitle = strcat(field('#pages'), ' |', word_count, ' words')
How can i add the term/word "pages" after the number of pages in the highlighted part of the subtitle? (see attached image)
Attached Thumbnails
Click image for larger version

Name:	pages.png
Views:	501
Size:	327.5 KB
ID:	195129  
Deobulakenyo is offline   Reply With Quote
Old 07-19-2022, 12:14 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
You add it in exactly the same way as the word "words" was added.

The last line of the template is concatenating strings together into a longer one. Changing this to the following should work:

Code:
subtitle = strcat(field('#pages'), ' pages', ' |', word_count, ' words')
You can combine the second and third parameters, but, the above is what I would usually do to keep each part of it separate and easy to change later. Though it probably has a small performance hit.
davidfor is offline   Reply With Quote
Advert
Old 07-19-2022, 12:19 AM   #3
Deobulakenyo
Guru
Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.
 
Posts: 705
Karma: 2153490
Join Date: Aug 2021
Location: Stupid Philippines
Device: Kobo Libra 2, Boyue Likebook P78
Quote:
Originally Posted by davidfor View Post
You add it in exactly the same way as the word "words" was added.

The last line of the template is concatenating strings together into a longer one. Changing this to the following should work:

Code:
subtitle = strcat(field('#pages'), ' pages', ' |', word_count, ' words')
You can combine the second and third parameters, but, the above is what I would usually do to keep each part of it separate and easy to change later. Though it probably has a small performance hit.
Thank you. I tried putting pages before I posted here but my punctuations were way off. Now it works fine and good with your examples.

Since we are on the topic of subtitle? is there a way to use the estimated reading hours that kobo added to the two recent fw updates to show instead of the number of words/ word count?
Deobulakenyo is offline   Reply With Quote
Old 07-19-2022, 12:31 AM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Deobulakenyo View Post
Thank you. I tried putting pages before I posted here but my punctuations were way off. Now it works fine and good with your examples.

Since we are on the topic of subtitle? is there a way to use the estimated reading hours that kobo added to the two recent fw updates to show instead of the number of words/ word count?
Not directly. If you have the driver calculating these values and sending it to the device, then you can reuse the code from those templates in this template.
davidfor is offline   Reply With Quote
Old 07-19-2022, 11:19 AM   #5
Deobulakenyo
Guru
Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.Deobulakenyo ought to be getting tired of karma fortunes by now.
 
Posts: 705
Karma: 2153490
Join Date: Aug 2021
Location: Stupid Philippines
Device: Kobo Libra 2, Boyue Likebook P78
Quote:
Originally Posted by davidfor View Post
Not directly. If you have the driver calculating these values and sending it to the device, then you can reuse the code from those templates in this template.

Thank you for the explanation.
Deobulakenyo is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Kobo Libra] How to fill subtitle automatically? Mister L Library Management 4 04-15-2022 06:26 AM
Sorting books in Kobo by series AND subtitle MashaT Library Management 1 01-06-2022 04:14 PM
How to add subtitle field in KOBO MashaT Library Management 15 01-04-2022 12:51 PM
From Kobo to Kindle: sleep & display question z000ao8q Kindle Developer's Corner 1 02-13-2015 10:30 AM
Question on display desertgrandma Feedback 1 07-05-2008 05:06 PM


All times are GMT -4. The time now is 08:55 PM.


MobileRead.com is a privately owned, operated and funded community.