View Single Post
Old 07-10-2017, 03:24 PM   #1
dennocoil
Member
dennocoil began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2016
Device: Samsung S6 Phone
Need help in Custom Columns, template syntax, and rounding numbers

I have no clue if Calibre supports this.

I'm creating a custom column ("built from other columns") that takes the Like and Dislike numbers of two other custom columns in a library to make it into a ratio of 100% for how good said book is.

I have the formula for it that consistently puts out a 0% to 100% ratio.
Code:
Likes / ( Likes + Dislikes ) X 100 = Ratio
But then comes rounding the numbers so Calibre doesn't make hundreds of decimal places or something weird like that. I just need to know what syntax in the template field that I need to put in to make it work and make it round numbers so that it doesn't give decimal places or only has 1 decimal place.

Last edited by dennocoil; 07-10-2017 at 04:26 PM.
dennocoil is offline   Reply With Quote