View Single Post
Old 08-07-2013, 09:41 AM   #548
Man Eating Duck
Addict
Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.
 
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
Quote:
Originally Posted by zoorakhan View Post

TLDR: How to make a custom column that takes value of a custom column (word count) divides it by a constant (3600) multplied by another constant (my WPM i.e. 350). Then the value produced is to be multiplied by value produced by dividing the value in another custom column (Gunning Fox Index) multiplied by another constant (Index Correction Factor, which is to be 8 in my case)
The calibre template language should be more than adequate to do these calculations.

Create a new custom column called Reading time or something, choose "Column built from other columns" as type. In the template field, use
Code:
program:multiply(divide(field('#words'),21000),divide(field('#gunning'),8))
I hope I got your formula right. 21000 is your base WPH speed, and Gunning index is divided by 8 to get your gunning factor. To tweak it, the easisest is to double-click a field in the column "Reading time", and you can change the formula while seeing a live preview.

Change #words and #gunning according to your custom column names.

You'll probably want to format the number, to get two decimal digits you can wrap the template in format_number, ie
Code:
program:format_number(multiply(divide(field('#words'),21000),divide(field('#gunning'),8)), '{0:.2f}')
Hope this helps
Attached Thumbnails
Click image for larger version

Name:	reading_time.png
Views:	335
Size:	21.6 KB
ID:	109042   Click image for larger version

Name:	reading_time_column_view.PNG
Views:	344
Size:	34.4 KB
ID:	109043  
Man Eating Duck is offline   Reply With Quote