Forum Discussion

Re: Formula Change from Decimal to Percentage

Correct, but the styling is taking that field to allow highlighting [Total Job Gross Margin RT]

------------------------------
Alex Bennett
------------------------------

8 Replies

  • AlexBennett3's avatar
    AlexBennett3
    Qrew Trainee
    UPDATE: 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
    ------------------------------
    • AlexBennett3's avatar
      AlexBennett3
      Qrew Trainee
      Any 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
      ------------------------------
      • AustinK's avatar
        AustinK
        Qrew Commander
        Add 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>" )