# Description

The FormatCurrency function returns an expression formatted as a currency value using the currency symbol defined in the computer's control panel.

This function has the form:

``FormatCurrency(expression [,NumDigAfterDec [,IncLeadingDig [,UseParForNegNum [,GroupDig]]]])``

Parameter Description
expression (required) The expression to be formatted
NumDigAfterDec (optional) Indicates how many places to the right of the decimal are displayed. Default is -1 (the computer's regional settings are used)
IncLeadingDig (optional) Indicates whether or not a leading zero is displayed for fractional values:
• -2 = TristateUseDefault - Use the computer's regional settings
• -1 = TristateTrue - True
• 0 = TristateFalse - False
UseParFor
NegNum
(optional) Indicates whether or not to place negative values within parentheses:
• -2 = TristateUseDefault - Use the computer's regional settings
• -1 = TristateTrue - True
• 0 = TristateFalse - False
GroupDig (optional) Indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings:
• -2 = TristateUseDefault - Use the computer's regional settings
• -1 = TristateTrue - True
• 0 = TristateFalse - False

# Examples

The following examples show the basic use of this function:

## Example 1

``````Msgbox(FormatCurrency(20000))
``````

This produces the following result:

``` \$20,000.00```

## Example 2

Setting number of decimals:

``````Msgbox(FormatCurrency(20000,2))
Msgbox(FormatCurrency(20000,5))
``````

This produces the following result (each line in a separate pop-up message box):

``` \$20,000.00 \$20,000.00000 ```

## Example 3

Fractional values with or without a leading zero:

``````Msgbox(FormatCurrency(.20,,0))
Msgbox(FormatCurrency(.20,,-1))
``````

This produces the following result (each line in a separate pop-up message box):

``` \$.20 \$0.20 ```

## Example 4

Negative values inside parentheses or not:

``````Msgbox(FormatCurrency(-50,,,0))
Msgbox(FormatCurrency(-50,,,-1))
``````

This produces the following result (each line in a separate pop-up message box):

``` -\$50.00 (\$50.00)```

## Example 5

Grouping a million dollars - or not:

``````Msgbox(FormatCurrency(1000000,,,,0))
Msgbox(FormatCurrency(1000000,,,,-1))
``````

This produces the following result (each line in a separate pop-up message box):

``` \$1000000.00 \$1,000,000.00```

# Miscellaneous Information

 Supported in Version: 2

Content