Quote:
Originally Posted by Nyssa
Chaley - Going off of a similar issue as the previous "penny problem" (thanks again  ), I have Calibre set up to "highlight" all of my freebies with text coloring "If the price column is equal to value: 0.00".
Unfortunately, calibre can not seem to determine the difference between "0.00" and "undefined", nor can I point out that distinction in the rules, so anything that has not yet been priced is also been "highlighted".
Any suggestions?
Please & Thank you.
|
You are correct. Empty is considered to be zero.
You can get around this by using an advanced rule that can check if the column is empty before comparing it to zero. Here is an example:
Code:
program:
test(field('#myfloat'), cmp(raw_field('#myfloat'), 0, '', '#00aa00', ''), '')
The "test" function first checks to see if the field contains any text. If it does then it compares the field with zero, and if equal returns (in this example) the color green. Otherwise it returns nothing.
You must use raw_field() in the comparison because of the formatting. The word "Price" is not a number. You must use field() in the test so you can tell the difference between empty and "Price: 0.00" (or whatever it is).