# I want a number to turn red when it is negative

• 0
• Question
• Updated 3 years ago

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?

• 160 Points Posted 3 years ago

• 0
• 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.
• 160 Points Thanks....is there a way to make this not display not as 0.26 and as a percentage?
• 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)&"%")
• 160 Points Perfect!