Formula Field Coloring Help

• 1
• Question
• Updated 2 years ago
Hey, guys, I have an issue trying to color the font and change the font size in a formula text field (which I made to be able to use HTML for a formula numeric field).

The issue is that the number is formatted as currency, so I am trying to pull that through into the formula text field, and I managed that, but now I can't figure out where to place the color tags.

Here is the formula.
var number Value = Round([Calculated SL Tax],0.01);

var text Decimals = "." & Right(ToText(Int(\$Value * 100)),2);

var text Thousands = If(\$Value>=1000,ToText(Int(\$Value/1000)));

var text Hundreds=Right(ToText(Int(\$Value)),3);

If(\$Value=0,"\$0.00",

If(\$Value<0, "- ")

&

"\$" & List(",",\$Thousands,\$Hundreds) & \$Decimals)

This works in returning the calculated number with the proper currency formatting, but now how do I go about changing the color and size of the font?
• 940 Points Posted 2 years ago

• 1
• 4,022 Points Try this:

"<div style=\"font-size: 9pt; color:black;background-color:orange; width:80px; text-align:center; \">"&"YOUR TEXT VALUE HERE"&"</div>",
• 940 Points If I follow you, you're saying to create a third field that would pull from this field and wrap that in the div style to get the coloration? If so, I think that might just work.
• 4,022 Points yea, thats what I am thinking. It might be the fastest way to your solution.
• 4,022 Points the formula would look like this though:

"<div style=\"font-size: 9pt; color:black;background-color:orange; width:80px; text-align:center; \">"&[YOUR FORMULA FIELD HERE]&"</div>",
• 940 Points Eric, you are a genius my friend, thank you! It's perfect
• 4,022 Points you're welcome! any time.