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 12-10-2018, 10:07 AM   #1
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
How many hours for a book

I have a plugin which shows how many words are in a book. Taking in consideration average reading speed is it possible to have a column with predicted hours per book value?

The math is like:
(number of words)/(average words per hour)

I know my reading speed, calibre doesn't have to calculate it! I just need it to make one simple calculation

I tried making a column based on another column:
{#words}/11160

but it didn't work

Last edited by Sarmat; 12-10-2018 at 10:11 AM.
Sarmat is offline   Reply With Quote
Old 12-10-2018, 10:35 AM   #2
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Sarmat View Post
I have a plugin which shows how many words are in a book. Taking in consideration average reading speed is it possible to have a column with predicted hours per book value?

The math is like:
(number of words)/(average words per hour)

I know my reading speed, calibre doesn't have to calculate it! I just need it to make one simple calculation

I tried making a column based on another column:
{#words}/11160

but it didn't work
You can use the Template Functions utility.

Click image for larger version

Name:	Screenshot from 2018-12-10 10-32-32.png
Views:	116
Size:	144.2 KB
ID:	168271

bernie

EDIT

https://manual.calibre-ebook.com/template_lang.html

Last edited by gbm; 12-10-2018 at 10:40 AM. Reason: Add link for template help page.
gbm is offline   Reply With Quote
Advert
Old 12-10-2018, 11:10 AM   #3
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
I have experimented dozen times with divide(x, y) in different formats and styles
but i failed

examples:
{divide(10, 2)}
divide(10, 2)
Sarmat is offline   Reply With Quote
Old 12-10-2018, 11:14 AM   #4
NSILMike
Guru
NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.NSILMike turned on, tuned in, and dropped out.
 
Posts: 735
Karma: 35936
Join Date: Apr 2011
Location: Shrewsury, MA
Device: Lenovo Android Tablet
Just do it yourself since you know how many words per book.
NSILMike is offline   Reply With Quote
Old 12-10-2018, 11:17 AM   #5
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
I am too lazy for this
and besides I have a lot of books
Sarmat is offline   Reply With Quote
Advert
Old 12-10-2018, 11:22 AM   #6
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Sarmat View Post
I have experimented dozen times with divide(x, y) in different formats and styles
but i failed

examples:
{divide(10, 2)}
divide(10, 2)
You will need to use Using functions in templates - template program mode or Using general program mode.

bernie
gbm is offline   Reply With Quote
Old 12-10-2018, 10:24 PM   #7
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
The following template should work:

Code:
program:
format_number(divide(raw_field('#word_count'),11160),'{0:5.2f}')
You will need to use the correct column name and output template to suit.
davidfor is offline   Reply With Quote
Old 12-11-2018, 07:34 AM   #8
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
Quote:
Originally Posted by davidfor View Post
The following template should work:

Code:
program:
format_number(divide(raw_field('#word_count'),11160),'{0:5.2f}')
You will need to use the correct column name and output template to suit.
It has worked, thank you.
Sarmat is offline   Reply With Quote
Old 12-11-2018, 06:51 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,461
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by NSILMike View Post
Just do it yourself since you know how many words per book.
Quote:
Originally Posted by Sarmat View Post
I am too lazy for this
and besides I have a lot of books
All us computer users are lazy and dedicated to the principal that simple, repetitive tasks should be done by computers freeing us for the important decisions such as which book to read next.
DNSB is offline   Reply With Quote
Old 12-12-2018, 05:39 AM   #10
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
Quote:
Originally Posted by davidfor View Post
The following template should work:

Code:
program:
format_number(divide(raw_field('#word_count'),11160),'{0:5.2f}')
You will need to use the correct column name and output template to suit.
Is it possible to make Calibre think that
12 is bigger than 3
or that
23 is bigger than 4?

for now Calibre considers only first character in the number when sorting
can I have it sort everything right?
Sarmat is offline   Reply With Quote
Old 12-12-2018, 08:55 AM   #11
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Sarmat View Post
Is it possible to make Calibre think that
12 is bigger than 3
or that
23 is bigger than 4?

for now Calibre considers only first character in the number when sorting
can I have it sort everything right?
In the definition of the column, there is an option to set the type for searching and sorting. Setting that to "Number" works here.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Longest audio book? Seveneves is 96 hours long! moyogi2 Audiobook Discussions 22 05-21-2017 05:27 AM
Getting book list takes hours brightjh01 Devices 7 12-22-2012 05:31 PM
Kobo Cyber Monday e-book sale 24 hours only!! apesmom Deals and Resources (No Self-Promotion or Affiliate Links) 26 11-26-2012 11:06 PM
Too many hours for a book armjorge Calibre 1 07-11-2010 10:23 AM


All times are GMT -4. The time now is 11:32 PM.


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