Quantcast
Channel: MobileRead Forums - Reading and Management
Viewing all articles
Browse latest Browse all 24026

Need help in Custom Columns, template syntax, and rounding numbers

$
0
0
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.

Viewing all articles
Browse latest Browse all 24026

Trending Articles