At the risk of clogging up the list further, I shall correct myself:

FormatAsDollars ( Amount ; Precision ) =

Let ([
      DollarsText = Int ( Amount ) ;
      Cents = Abs (  10 ^ precision * Round ( Amount ; precision ) ) ;
CentsText = Right ( "000000000000" & Mod ( Cents ; 10 ^ Precision ) ; Precision )
     ] ;
     "$" & DollarsText & "." & CentsText
    )

cheers

Tom

Reply via email to