IF Statement in Custom Formula for number > 0 returning "+"

I’m trying to show spreads for NFL games which typically show as something like Arizona +7 or Green Bay -13.5. The spread is a number in my database right now. Therefore, in my app I’d like to do something like:

  • IF the spread is less than 0, show -5. <-- This is solved already using a Custom Formula to make the number negative (e.g., CUSTOMFORMULA: -spread)
  • IF the spread is greater than 0, show +5. <-- I need help here. How do I show a + in front of the spread number if it’s positive?

Note - I found this solution but it didn’t see to resolve what I needed.

Hi @aqsmith08,

Quick solution which comes to my mind is to put “+” into separate text field, and make it Sometimes Visible (depending on spread value).
Though probably you will need to play with layout to make it look nice.

Other option - you can make 2 text fields, one for negative values, other for positive. Make them Sometimes Visible depending on spread value. And in the text field itself you put “-” or “+” before the actual variable. Again, you will need to experiment with layout.

I would do it the same way that Victor has suggested.

Please let us know if you get it working. UI issues can sometimes be a pain to solve.

1 Like

Thank you, @Victor & @Colin . Marking this as the solution and I’ll give it a try.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.