Issue 115057 - Conditional formatting ">0" does include 0
Summary: Conditional formatting ">0" does include 0
Alias: None
Product: Calc
Classification: Application
Component: formatting (show other issues)
Version: OOo 3.2.1
Hardware: PC Linux, all
: P4 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: oooqa
Depends on:
Reported: 2010-10-14 11:58 UTC by iassan
Modified: 2013-01-29 21:48 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description iassan 2010-10-14 11:58:48 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: 3.2.1 
OOO320m19 (Build:9505)
ooo-build, Ubuntu package 1:3.2.1-7ubuntu1
Comment 1 Joost Andrae 2010-10-14 15:38:40 UTC
Just try this format to differentiate <0, >0 and 0

"plus" 0;"minus" 0;"null" 0
Comment 2 iassan 2010-10-14 17:01:53 UTC
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.
Comment 3 Regina Henschel 2010-10-14 17:59:27 UTC
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;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