Sue
if the result is for display purposes only) you might be able to use
merge fields on your layout since you can then specify the Number
format. But if this is not possible for some reason then this formula
gives currentpayfield formatted as a dollar amount with 2 cents digits:
"$"& Int (currentpayfield) & "." & Left (100 * Round(currentpayfield-
Int (currentpayfield) ; 2) & "00" ; 2)
if you're using FMP 7 or later you could use:
Let ([ dollars = Int (currentpayfield) ;
cents = Round (currentpayfield - dollars ; 2) ;
centsAsText = Left (100 * cents & "00" ; 2)
] ;
"$" & dollars & "." & centsAsText
)
to make it more readable
cheers
Tom
On 2 Apr 2007, at 18:38, Sue wrote:
I have a calculated text field made up concantenated text and
various number fields.
Some of these numbers I need to have show up in the final text as
dollar amounts with two decimal places.
For example, I can concantenate in my calculation as follows:
"Your current hourly pay is $" & (SetPrecision (currentpayfield;2))
and get: Your current pay is $10.5
but I want it to come out as: Your current hourly pay is $10.50
Round and truncate don't solve the problem either.
Any suggestions on how to correctly write this calculation so I can
get the desired result?
Thanks!
Sue