5 Replies Latest reply on Nov 3, 2016 2:34 PM by oldgustav

# Formatting a cash value in a calculation field

I have a number field in a layout that is formatted to display a cash value, say £125.50. This field also appears in a calculation field thus:

"Please could you put a note in your calendar to let us have the balance of" &" " &"£" & TableName::NumberField &" " & "on or before" &" "& Day ( TableName::BalanceDueDate )&" " &MonthName ( TableName::BalanceDueDate ) & "." &" " & "When it comes through, we'll send an email acknowledging safe receipt, along with useful information about your stay." & ¶&¶

The problem is that the cash value appears as £125.5 in the calculation field. Is there a function that will add the extra zero when required? I can't seem to find one. Other cash values such as £125 and £125.25 obviously all work fine (although I'd prefer £125 to appear as £125.00 - as it does in the currency formatted field).

Thanks!

• ###### 1. Re: Formatting a cash value in a calculation field

Let ( [ I = Int ( TableName::NumberField ) ;

d = TableName::NumberField - I

] ;

"£" & I & "." & d * 100

)

• ###### 2. Re: Formatting a cash value in a calculation field

Wow, how do you do that? Thanks so much!

• ###### 3. Re: Formatting a cash value in a calculation field

Except that... when the cash value is £125 it now displays as £125.0

I don't suppose there is a way to fix that?

• ###### 4. Re: Formatting a cash value in a calculation field

Let ( [ I = Int ( TableName::NumberField ) ;

d = TableName::NumberField - I

] ;

"£" & I & "." & Left ( d * 100 & "0" ; 2 )

)

• ###### 5. Re: Formatting a cash value in a calculation field

Awesone Phil. Thanks, this is amazing!