![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,364
Karma: 8012652
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}') |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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!!!!!
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |