FormatCurrency Function
Updated: April 2009
Returns an expression formatted as a currency value using the currency symbol defined in the system control panel.
FormatCurrency(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit
[,UseParensForNegativeNumbers [,GroupDigits]]]])
When one or more optional arguments are omitted, values for omitted arguments are provided by the computer's regional settings. The position of the currency symbol relative to the currency value is determined by the system's regional settings.
Note:
|
|---|
|
All settings information comes from the Regional Settings Currency tab, except leading zero, which comes from the Number tab. |
The following example illustrates the use of the FormatCurrency function.
Dim number number = -12345.6789 MsgBox (FormatCurrency (number)) ' The UseParensForNegativeNumbers parameter is set to false. MsgBox (FormatCurrency (number, -1, vbUseDefault, vbFalse)) ' The GroupDigits parameter is set to false. MsgBox (FormatCurrency (number, , , , vbFalse))
Community Additions
Show:
Note: