Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2017, 03:11 PM   #1
fancoir
Junior Member
fancoir began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2017
Device: none
Question customised column puzzle

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!
fancoir is offline   Reply With Quote
Old 03-14-2017, 04:13 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,446
Karma: 8012886
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)
chaley is offline   Reply With Quote
Advert
Old 03-14-2017, 05:24 PM   #3
fancoir
Junior Member
fancoir began at the beginning.
 
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
fancoir is offline   Reply With Quote
Old 03-14-2017, 05:28 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,446
Karma: 8012886
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.
chaley is offline   Reply With Quote
Old 03-14-2017, 05:50 PM   #5
fancoir
Junior Member
fancoir began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Mar 2017
Device: none
Thanks Charley - worked it out.

You've been a great help. much appreciated.
fancoir is offline   Reply With Quote
Advert
Reply


Forum Jump

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 03:11 AM
How to create customised library sahuajeet Library Management 1 12-24-2012 05:23 PM
customised columns handycam Devices 3 03-14-2011 12:04 AM
Ended PRS-505 (Currently PRS+ customised) suecsi Flea Market 9 07-27-2010 06:51 AM


All times are GMT -4. The time now is 04:08 PM.


MobileRead.com is a privately owned, operated and funded community.