|
|
#1 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2017
Device: none
|
Hi everyone,
Hope someone can help me with a problem I'm having creating a customised column in Calibre. I have created 3 columns (#plot, #pace and #character) which each contain integer values between 1 and 5. I now want to create a new column #score which is calculated from the average of the 3 columns. And just to complicate things I want to add a weighting of 1.5 to plot. (i.e. #plotx1.5) This looks possible but I'm getting lost in the manual. Grateful if anyone can help out. Thanks! |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Something like this General Program Mode template:
Code:
program:
divide(
add(
add(field('#pace'),
field('#character')),
multiply(field('#plot'), 1.5)),
3)
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2017
Device: none
|
Thanks Chaley!
I've been trying to get this to work for hours but was way off a solution. One more thing - how do I format the answer to 2 decimal places? Thanks again |
|
|
|
|
|
#4 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Use the format_number function. I leave it as an exercise to work out the details.
|
|
|
|
|
|
#5 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Mar 2017
Device: none
|
Thanks Charley - worked it out.
You've been a great help. much appreciated. |
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using "Build column from other column" custom-column type | HFC3 | Library Management | 3 | 07-07-2013 04:11 AM |
| How to create customised library | sahuajeet | Library Management | 1 | 12-24-2012 06:23 PM |
| customised columns | handycam | Devices | 3 | 03-14-2011 01:04 AM |
| Ended PRS-505 (Currently PRS+ customised) | suecsi | Flea Market | 9 | 07-27-2010 07:51 AM |