Skip to main content
Question

Trying to format with 2 decimal places


Forum|alt.badge.img+8

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?

This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24

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>"


Forum|alt.badge.img+1

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])
    )