FormatCurrency Function
Returns a expression formatted as a currency value using the currency symbol defined in the System Control Panel.
FormatCurrency (Expression[,numdigitsafterdecimal][,includeleadingdigit][,useparensfornegativenumbers] [, GroupDigits]]])
Arguments
Expression
Required. Expression to be formatted.
Numdigitsafterdecimal
Optional. Numeric value indicating how many places to the right of the decimal are displayed. Default value Is-1, which indicates that computer ' s regional settings are used.
IncludeLeadingDigit
Optional. TriState constant that indicates whether or not a leading the zero is displayed for fractional values. The Settings section for values.
UseParensForNegativeNumbers
Optional. TriState constant that indicates whether or not to place negative values within parentheses. The Settings section for values.
GroupDigits
Optional. TriState constant that indicates whether or not numbers are grouped using the group delimiter specified in the computer ' s Regional Settings. The Settings section for values.
Settings
The IncludeLeadingDigit, useparensfornegativenumbers, and groupdigits arguments have the following settings:
Constant Value Description
TristateTrue-1 True
Tristatefalse 0 False
TristateUseDefault-2 use the setting from the computer ' regional settings.
Remarks
When one or more optional arguments are omitted, values for omitted arguments-are provided by the computer ' s regional Ings. The position of the currency symbol relative to the currency value are determined by the system ' s regional settings.
Note All settings information comes to Regional Settings Currency tab, except leading zero, which comes from the N Umber tab.
The following example uses the FormatCurrency function to format the expression as a currency and assign it to mycurrency:
Dim mycurrency
Mycurrency = formatcurrency (1000) ' mycurrency contains $1000.00.
Requirements