I want a number to turn red when it is negative

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

So I have a numeric formula that calculates two fields to come up with a percentage savings between the two numbers.  I am using this formula

Round([Monthly Sub Savings ($)_used for calculation]/ [Annual Single Issue Price_used for calculation],0.01)

The works great.  What I want is that when the number is a negative number (-23%) I would like the number to show up as RED so that when we fill it in we see that right away to make it noticeable.

How do I do that?

Photo of Cecelia

Cecelia

  • 160 Points 100 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Douglas Vega

Douglas Vega

  • 0 Points
Create a new "Text Formula Field" and check "Allow some HTML tags to be inserted in the field" on its settings. Then use this formula:

If(Round([Monthly Sub Savings ($)_used for calculation]/ [Annual Single Issue Price_used for calculation],0.01)<0, "<span style=\"color:red; font-weight:bold\">"&ToText(Round([Monthly Sub Savings ($)_used for calculation]/ [Annual Single Issue Price_used for calculation],0.01))&"</span>", ToText(Round([Monthly Sub Savings ($)_used for calculation]/ [Annual Single Issue Price_used for calculation],0.01)))

The Formula-Numeric field you were using may not be necesssary but it is up to you.
Photo of Cecelia

Cecelia

  • 160 Points 100 badge 2x thumb
Thanks....is there a way to make this not display not as 0.26 and as a percentage?
Photo of Douglas Vega

Douglas Vega

  • 0 Points
Try this one:
If(Round([Monthly Sub Savings ($)_used for calculation]/ [Annual Single Issue Price_used for calculation],0.01)<0, "<span style=\"color:red; font-weight:bold\">"&ToText(Round([Monthly Sub Savings ($)_used for calculation]/ [Annual Single Issue Price_used for calculation],0.01)*100)&"%</span>", ToText(Round([Monthly Sub Savings ($)_used for calculation]/ [Annual Single Issue Price_used for calculation],0.01)*100)&"%")
Photo of Cecelia

Cecelia

  • 160 Points 100 badge 2x thumb
Perfect!