Skip to main content
Question

Display % sign in formula text field and color code

  • November 30, 2023
  • 0 replies
  • 118 views

Forum|alt.badge.img+6

I have a formula text field to display text when a condition is met. This formula works fine and displays the % sign but it's just in black text. I would like to make the text red.

If(
[Indirect Exp Overide] > (0.1 * [Subtotal Applicable Items]),
"Indirect Expenses Override Amount is greater than 10% of the Subtotal Applicable Items amount")

However, when I add the color coding part of the formula, then it doesn't like the % sign and highlights it in yellow:

If(
[Indirect Exp Overide] > (0.1 * [Subtotal Applicable Items]),
<div style="color:red">"Indirect Expenses Override Amount is greater than 10% of the Subtotal Applicable Items amount</div>)

I have tried using '\' around  %  but that doesn't work. If I change it to the word percent, then the < in front of div is highlighted. I tried adding " in front of the <div> and at the end of </div> but that didn't help either.

If(
[Indirect Exp Overide] > (0.1 * [Subtotal Applicable Items]),
<div style="color:red">"Indirect Expenses Override Amount is greater than 10 percent of the Subtotal Applicable Items amount</div>)

What am I overlooking to get this correct? I want text red and % instead of percent....



------------------------------
Amy Gosz
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+9
  • Registered
  • November 30, 2023

Can you post the full formula and copy it here? The way you have it copied looks like it's a syntax error with using " versus '. I would expect something more like this where the entire string is wrapped in " and then the style is wrapped in '

If(
[Indirect Exp Overide] > (0.1 * [Subtotal Applicable Items]),
"<div style='color:red'>Indirect Expenses Override Amount is greater than 10 percent of the Subtotal Applicable Items amount</div>")



------------------------------
Chayce Duncan
------------------------------