format()

Examples


The format() function converts the contents of a currency or variable currency field to a string, applying the specified formatting.

Syntax

format(currency, cur_symbol, thou_sep, dec_#, type)

Parameters

currency A currency or variable currency field or value you want to format and convert to a string.

cur_symbol – A boolean value indicating whether the currency symbol will be included with the currency amount. True indicates that the symbol will be included; false indicates that no symbol will be used.

thou_sep – A boolean value indicating whether the thousands separator will be included with the currency amount. True indicates that the separator will be used; false indicates that no separator will be used.

dec_# – An integer value indicating the number of places that appear to the right of the decimal separator. For currency fields, this must be between 0 and 5. For variable currency fields, it must be between 0 and 15.

If this value is greater than or equal to 1000, the multiformat value associated with the specified integer will be applied to the item indicated by the currency parameter. If the cur_symbol and thou_sep parameters are set to true, the currency symbol and thousands separator defined for the multiformat value will be used.

type – One of the four constants shown below, indicating how a negative currency should be displayed. To display a percentage sign at the end of the number, add 100 to the constant (for instance, MINUSNEG+100).

[spacer]

Constant

Description

SYSTEMNEG

The international settings in the operating system.

MINUSNEG

Minus sign

PARENNEG

Parentheses

CRNEG

CR


Return value

String

Comments

The currency symbol and thousands separator used with this function are the operating system defaults, not any symbols specified for particular multiformat values using the functions in the Currency function library.


Documentation Feedback