Apache OpenOffice (AOO) Bugzilla – Issue 115057
Conditional formatting ">0" does include 0
Last modified: 2013-01-29 21:48:06 UTC
I created formatting formula like this: "[RED][>0]#0;[BLACK]#0". Then created three cells with "1", "0" and "-1" numbers and applied my formatting. "1" is red (OK), "-1" is black (OK), but "0" id red (wrong). Interesting thing, when I change this formula into "[RED][<0]#0;[BLACK]#0" (condition is "<0"), everything is correct, only "-1" is red. Exact version of OOo is: OpenOffice.org 3.2.1 OOO320m19 (Build:9505) ooo-build 3.2.1.4, Ubuntu package 1:3.2.1-7ubuntu1
Just try this format to differentiate <0, >0 and 0 "plus" 0;"minus" 0;"null" 0
OK, that works. But still, according to OOo help my number format code is valid and it should work as I described. But maybe there's something I don't know and it should be put into documentation or help.
The problem is, that you have mixed the two ways to describe conditions. One way is to simple specify different formats, divided by semicolon. Then the first one is for positive, the second one for negative and the third one for zero. If the third format is missing, then zero is treated as positive. [RED]#0;[BLACK]#0;[GREEN]#0 ==> positive red, negative black, zero green [RED]#0;[BLACK]#0 ==> positive and zero red, negative black The other option is to explicitly specify conditions. But then you would need to specify a condition in _all_ cases. Missing cases get default format. [RED][>0]#0;[GREEN][<0]#0 becomes [RED][>0]#0;[GREEN][<0]#0;Standard ==> positive in red, negative in green, zero in default black But you are right, that OOo is not consistent in handling mixed notation. [RED][>1]#0;[GREEN]#0 ==> 1 is green [RED][>0]#0;[GREEN]#0 ==> 0 is red [RED][>-1]#0;[GREEN]#0 ==> -1 is green