View Single Post
Old 04-12-2023, 02:56 PM   #2
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,052
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
This template should do it.

Code:
program:
## Change these to your own columns.
ratings = $#ratingcol;
votes = $#votecol;

## This multiplies 'ratings' with 'votes' and then formats the number to use 2 decimal points.
format_number(multiply(ratings,votes), '{0:5.2f}')

## Alternately, delete the above line and uncomment this if you want it rounded to nearest whole.
## round(multiply(ratings,vote))
Replacing the first four lines with these skips a step and pulls right from the ID columns:

Code:
program:
ratings = select($identifiers, 'grratings');
votes = select($identifiers, 'grvotes');
Here is all the available arithmetic functions for template:
https://manual.calibre-ebook.com/gen...tml#arithmetic

Last edited by ownedbycats; 04-12-2023 at 03:14 PM. Reason: Added link to ref
ownedbycats is offline   Reply With Quote