How to dispay -ve numbers in red color

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have a numeric field. I want to display all -ve numbers of that field in red color. How can I do so?
Photo of Susmita

Susmita

  • 0 Points

Posted 6 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
I assume by "-ve" you are referring to negative numbers. This is an uncommon shorthand in the US.

You would use a row colorization formula in the report:

If( [field] < 0, "red")
Photo of Susmita

Susmita

  • 0 Points
But I don't want to color the entire row as I have several other numeric fields that may also contain negative number. I only want to color the  negative values. Is that possible?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
Use a text formula field with some HTML allowed and a formula such as this:

If( [field] < 0,
  "<span style='background-color: #EA3C53'>" & ToText([field]) & "</span>",
  [field]
)
Photo of Esther

Esther

  • 702 Points 500 badge 2x thumb
It works perfect to me, the only you need is to transform the last field in text :

If( [field] < 0, 
  "<span style='background-color: #EA3C53'>" & ToText([field]) & "</span>",
ToText ([field])
)

Thanks.
Photo of Susmita

Susmita

  • 0 Points
Text formula field wouldn't help as I need to summarize the field for reporting.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
Summarize on the original numeric field not the formula.
Photo of Susmita

Susmita

  • 0 Points
Then within the summery report is it possible to show the negative numbers in red some how?
Photo of Bill

Bill

  • 0 Points
Using the IF statement doesn't seem to work, as the number (difference) is showing as a positive number. How can I get 8-5 to equal -3 instead of 3?