09-11-2017, 02:04 PM | #1 |
Zealot
Posts: 147
Karma: 1502780
Join Date: Mar 2013
Device: Moto e5
|
Column Built from other Columns question
I am a fairly unsophisticated Calibre user, and I need some help creating a custom "column built from other columns."
Column #1 is a custom "floating point number" column named AudPrice (lookup = #price). Column #2 is the same and is named AmzPrice (lookup = #price2). I want the new column (TotalPrice; #price3) to add these two columns together. And I need it to be able to handle it if Column #2 is empty. In other words: If #1 = 1.99 & #2 = .99 then I want the new column to say 2.98 OR if #1 is 1.99 and #2 is empty, then I want it to say 1.99 rather than giving an error. Can anyone give me some code I can cut & paste into the "Template" box. Thanks |
09-11-2017, 04:13 PM | #2 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
This Template Program Mode template does it using the raw_field and the add functions.
Code:
{:'add(raw_field('#price'), raw_field('#price2'))'} |
09-15-2017, 11:08 AM | #3 |
Zealot
Posts: 147
Karma: 1502780
Join Date: Mar 2013
Device: Moto e5
|
Sorry for the delay in saying thanks, I just got the email notification of your response. I will give this a try.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Column built from other column : Mark read if evaluated | Cmely | Library Management | 1 | 02-26-2017 09:07 AM |
Yes/No column built from other columns | barlowrm | Calibre | 5 | 11-17-2016 02:34 PM |
A custom column built from other columns: simple math operations | Joanna | Calibre | 26 | 06-07-2016 04:35 AM |
Request: template-making assistance for column built from other columns | iienderii | Library Management | 9 | 04-04-2016 10:27 PM |
How to "copy" or combine tags in two columns not as a built column? | jecilop | Library Management | 7 | 09-04-2014 07:26 PM |