Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-02-2014, 09:55 PM   #1
apesmom
Wizard
apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.
 
apesmom's Avatar
 
Posts: 2,535
Karma: 24702524
Join Date: Apr 2011
Device: Boox Nova Air, Galaxy Note 10
Help creating custom column

I'm trying to create a new column to adds 2 other custom columns together.
Existing custom column 1 is 'c' and is a float formatted as ${0:5,.2f}
Existing custom column 2 is 'credit' and is also a float formatted as ${0:5,.2f}

The new column is to be named 'cost' and should add columns c + credit and format it ${0:5,.2f}

I assume I want to use Column type "Column built from other columns"
but I can't seem to find the proper syntax for my Template. I keep getting TEMPLATE ERROR: Invalid Conversion Specification.

So far my template looks like this: {#cost: 'add(#c, #credit)'}

I haven't even attempted to add the formatting yet.

Any help is greatly appreciated. Thanks!
apesmom is offline   Reply With Quote
Old 04-03-2014, 02:43 AM   #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: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The template for the #cost column should be something like
Code:
program: 
	v = add(raw_field('#c'), raw_field('#credit'));
	format_number(v, '${0:5,.2f}')
Using template program mode is required because the number format contains the { and } characters. Using raw_field instead of field is required because the #c or the #credit columns are themselves formatted and contain non-numeric characters.
chaley is offline   Reply With Quote
Advert
Old 04-03-2014, 11:30 AM   #3
apesmom
Wizard
apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.apesmom ought to be getting tired of karma fortunes by now.
 
apesmom's Avatar
 
Posts: 2,535
Karma: 24702524
Join Date: Apr 2011
Device: Boox Nova Air, Galaxy Note 10
That did it! Thank you, thank you, thank you!!!!!
apesmom is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Custom Column for Read and Date Read library addict Calibre Companion 11 03-22-2014 05:33 AM
Creating a Custom Column Link a_daley Library Management 5 02-16-2014 05:56 AM
Custom column returns value based on value of another custom column? calvin-c Calibre 3 09-14-2013 02:24 PM
Custom yes/no column built from long text column Philantrop Library Management 7 03-23-2013 07:44 PM
how to move value(s) of tag column to a custom made column zoorakhan Library Management 0 12-08-2012 03:53 AM


All times are GMT -4. The time now is 01:30 AM.


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