Hi there,
I’d like to have the text color change to red when a negative number is displayed in my column values.
Anybody have any suggestions on how to do that?
Many thanks in advance!
wdelaney (BOB member since 2011-07-06)
Hi there,
I’d like to have the text color change to red when a negative number is displayed in my column values.
Anybody have any suggestions on how to do that?
Many thanks in advance!
wdelaney (BOB member since 2011-07-06)
Well the easiest method is to simply right click on your cell, select “Format Number” and select any one of the pre-defined formats which show “[RED]” in the negative number field
Or you can just click Custom and key it in yourself.
I often use the following
Positive =
$#,##0.00
Negative =
[RED]($#,##0.00)
And the last two boxes, Zero and Undefined I use:
[RED]-
(Note: the dash is made by using ALT-0173, so that it shows up as a zero when exported to excel)
This works in XIR2, XIR3 and XIR4
JPetlev (BOB member since 2006-11-01)
JPetlev method is the easiest. But if you want some other color other than red you can try out using Alerter
NegNum:
If([Num]<0;1;0)
then assign the above variable to an alerter with the operand ‘’=’’ 1 and you will get the desired result.
HTH.
Amandeep
amandeepsharma89 (BOB member since 2012-05-23)
thanks you guys!
when I right clicked, selected Format Number, the predefined formats didn’t have any of the negative number selections in red, just black. It did offer the negative sign or the number in parentheses.
I used JPetlev’s custom code and it worked great!!
Thanks again!
wdelaney (BOB member since 2011-07-06)
If you want to continue this approch throught out your reports then apply it in universe by selecting object format of particular object.
Thanks,
Zaif
zaif235 (BOB member since 2010-06-15)