Forum Discussion
AustinK
5 years agoQrew Commander
Take what is in the field [Total Job Gross Margin F] and use that for the calculation instead. That is where the number comes from, correct?
AlexBennett3
5 years agoQrew Trainee
Correct, but the styling is taking that field to allow highlighting [Total Job Gross Margin RT]
------------------------------
Alex Bennett
------------------------------
------------------------------
Alex Bennett
------------------------------
- AlexBennett35 years agoQrew TraineeUPDATE: I changed the formula to *100 and it now displays as 28.134877
is there a way to only show 28.13, as well as adding a percent symbol?
------------------------------
Alex Bennett
------------------------------- AlexBennett35 years agoQrew TraineeAny suggestions on the percent sign? I changed the code to:
ToNumber(Left(ToText([Total Job Gross Margin F]),6))
So now my result is 28.13
------------------------------
Alex Bennett
------------------------------- AustinK5 years agoQrew CommanderAdd the percentage sign to your formula in the first post for the rich text field. Put it directly after where you are placing $margin.
You might be able to just add a new variable up top for this as well. This may or may not work as I typed it up. This is just a quick example. It still uses marginOne for the calculation(as that is a number) and then inserts marginTwo for the text. If you didn;t want to do multiple variables here you could also just put "%" in the formula below like I first mentioned. I just found this easier.
var number marginOne = [Total Job Gross Margin F];
var text marginTwo = $marginOne + "%";
If( $marginOne >= 0 , "<span style=\"background-color:#fbff00; font-size:16px; font-weight:bold\">"&$marginTwo&"</span>", "<span style=\"background-color:#ff0000; font-weight:bold\">"&$marginTwo&"</span>" )