Forum Discussion

JulieMeeker's avatar
JulieMeeker
Qrew Trainee
25 days ago

Trying to format with 2 decimal places

I have a Formula Rich Text field to display a grand total.  If the cents end in 0 like .10 it drops the final 0.  Here is my formula

"<p style=font-size:14pt;color:red;><b>"& "$" &
      
ToFormattedText(Round([Total with Tax & Fee],0.01),"comma_dot",3)& 
"</b></p>"

What do I need to add to show that final 0?

2 Replies

  • This is a formula from Sharon Faust, the QuickBase Junkie

     

    var text SALES = If(IsNull([Total]),"","$" &
    Part(ToFormattedText(abs([Total]),"comma_dot",3),1,".") & "." &
    PadRight(Part(ToText(abs([Total])),2,"."),2,"0"));

    var text COL = If([Total]<0,"Red");

    "<span style='" &
      "color:" & $COL & ";" &
      "display:block;" &
      "text-align:right;'>" &
      $SALES &
    "</span>"

  • Hi Julie,

    Here's 3 examples of how I've done this in a metric report. 

    If(IsNull([January]),"No Actuals",
        Case(
            [Measurement],
            "Total",
                "<div style='color: " & If([January] < [Metric Monthly Objective],"#FF0000",[January] >= [Metric Monthly Objective],"#228B22") & "'>"&If([Metric Type]="Currency","$")&ToFormattedText(Round([January],0.01),"comma_dot")&Case([Metric Type],"Currency","","Percent","%")&"</div>",
            "Financial",
                "<div style='color: " & If([January] < [Metric Monthly Objective],"#FF0000",[January] >= [Metric Monthly Objective],"#228B22") & "'>"&If([Metric Type]="Currency","$")&ToFormattedText(Round([January],0.01),"comma_dot")&Case([Metric Type],"Currency","","Percent","%")&"</div>",
            "Average",
                "<div style='color: " & If([January] < [Metric Monthly Objective],"#FF0000",[January] >= [Metric Monthly Objective],"#228B22") & "'>"&If([Metric Type]="Currency","$")&ToFormattedText(Round([January],0.01),"comma_dot")&Case([Metric Type],"Currency","","Percent","%")&"</div>",
            ToText([January])
        )