Quote:
Originally Posted by zoorakhan
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