Issue 58869

Summary: conditional brackets drop minus sign for 1-digit percents
Product: Calc Reporter: skelem <steve>
Component: formattingAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, lars_o_hansen
Version: OOo 2.0Keywords: oooqa
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
conditional format percent example
none
Test case of number format dropping minus sign none

Description skelem 2005-12-05 07:52:44 UTC
I followed the documentation for Conditional Brackets and made a format that works:
[BLUE][<0]#.0 "°C";[RED][>30]#.0 "°C";[BLACK]#.0 "°C"
This format works for positive and negative numbers.

Then I made this format:
[RED][<-.2]0.00%;[BLACK][<.2]0.00%;[GREEN]0.00%
Which is supposed to turn numbers less than -20% red, greater than or equal to
20% green, and numbers between -20% and +20% black.
It does the coloring okay, but -5% (-.05) drops the minus sign when the number
is displayed!
If I change the format for that one cell to General, then the minus sign appears.
Comment 1 skelem 2005-12-05 07:54:15 UTC
Created attachment 32045 [details]
conditional format percent example
Comment 2 lars 2005-12-05 19:37:55 UTC
confirmed on Windows XP Pro SP2 with OOo 2.0.1 RC2; it is also true for some 2 
digit percents, see 10 to 20 % above the 5%. are numbers like -5,000000001 
intentional?
Comment 3 frank 2005-12-15 13:31:53 UTC
Hi Eike,

please have a look at this one.

Frank
Comment 4 ooo 2005-12-15 15:02:08 UTC
Accepted.

If the second subsection of a number format code is applied, a minus sign has to
be present in the format code. This is intentional if no condition is given to
be able to have format codes like 0;(0) but if a condition is present the minus
sign must be added automatically.
Comment 5 zhujia 2006-01-27 00:09:08 UTC
I am able to reproduce this defect using Windows XP SP2, openoffice version 
OOo2.0. 
Here are the replication steps:
1.Open a new calc document.
2.Right click on “column A†property, select Format Cells...
3.In the Category drop-down list, select “Percentâ€. In the Format list, 
select the third option from top. The following format should show up in the 
Format code section: [<-0.1][RED]0.00%;[<0.1][BLACK]0.00%;[GREEN]0.00%
4.Click OK to go back to the document. 
5.Now enter some numbers in column A, the numbers I entered were:-20, -15, -
12, -11, -10, -9, -5, -1, 1, 5, 9, 10, 11, 20.
6.Note that some of the auto formatted numbers were displayed wrong.

I performed some follow-up tests as following:
1. I replicated this bug on Linux OS version 2.4.31 and OOo2.0, the defect 
persists. 
2. I tried to vary the input numbers and found out that apparently the range 
leading to the bug is from -1 to -10. 
3. I tried to vary the Format Cells options. I found that there are also 
problems for the numbers I entered if formatting code is: 
[<-0.2][RED]0.00%;[<0.2][BLACK]0.00%;[GREEN]0.00% or 
[<-0.2][RED]0.00%;[<0.2][BLACK]#.00%;[GREEN]0.00%, which are the forth and the 
fifth option from the Format list. These are the separate issues. 
Comment 6 zhujia 2006-01-27 00:16:45 UTC
There are defect on 3rd, 4th and 5th options from Format list. I think they 
are caused by a same bug. so they should be dealt with together. 
Comment 7 pinfeng 2007-05-25 22:05:58 UTC
I encountered a similar defect but not necessarilly relating to percentages.
Negative numbers smaller 1 are displayed as positive if their amount of zeros
after decimal point is equal or larger the formatted style of the cell
(positions after decimal point specified).

Please see my issue posted here:
http://www.openoffice.org/issues/show_bug.cgi?id=58869
Comment 8 pinfeng 2007-05-25 22:06:23 UTC
I encountered a similar defect but not necessarilly relating to percentages.
Negative numbers smaller 1 are displayed as positive if their amount of zeros
after decimal point is equal or larger the formatted style of the cell
(positions after decimal point specified).

Please see my issue posted here:
http://www.openoffice.org/issues/show_bug.cgi?id=77821
Comment 9 sander_marechal 2007-09-18 11:11:29 UTC
I am seeing the exact same problem in OOo on Linux (Debian Etch). As zhujia
commented on Fri Jan 27 00:09:08 +0000 2006, the range of numbers affected by
this is between -10 and 0. I have attached a test case for Writer that shows the
original Writer table, the same table but with the number format
[<-0.1][RED]0%;[>0.1]0%;[BLACK]0% applied, and below that two manually formatted
tables. One table showing what I see and the other what I am supposed to be seeing.
Comment 10 sander_marechal 2007-09-18 11:13:04 UTC
Created attachment 48301 [details]
Test case of number format dropping minus sign
Comment 11 Joe Smith 2007-09-18 15:55:44 UTC
Another observation, although I'm not sure what it means:

The sample data from sander_marechal has the correct sign if you change the
number format from
[<-0.1][RED]0%;[>0.1]0%;[BLACK]0%
to
[<-0.01][RED]0%;[>0.1]0%;[BLACK]0%

In that case, now the sample value -0.05 is correctly formatted as "-5%",
however a value of -0.01 is formatted as "1%". That value will then be shown
correctly if the format threshold is changed to "[-0.001]".

So the magnitude of the data value relative to the threshold seems to have some
effect.

Calc shows this same problem, but there is no issue filed (as far as I can see).
 It might have a better chance of being fixed as a Calc bug, and maybe Writer
would get the benefit as well.
Comment 12 Joe Smith 2007-09-18 15:57:07 UTC
Oops--now I see it /is/ a Calc bug ;-)
Comment 13 ooo 2008-07-01 12:50:37 UTC
Not doable in 3.0 time frame, retargeting to 3.1
Comment 14 ooo 2009-03-03 20:02:38 UTC
Out of schedule, retargeting to 3.2
Comment 15 thorsten.ziehm 2009-11-16 10:43:33 UTC
OOo 3.2 is in show stopper mode. It does seems that it is a stopper. Therefore I
change the target of this issue OOo 3.x.
Comment 16 Marcus 2017-05-20 11:11:33 UTC
Reset assigne to the default "issues@openoffice.apache.org".