FORMATCURRENCY(expression [,numdigitsafter] [,includeleadingdigit] [,negativeuseparens] [,groupdigits])

Returns the expression formatted as a currency value (String).


expressionThe expression to be formatted.
numdigitsafter(Optional) The number of places to the right of the decimal place.
includeleadingdigit(Optional) A vbTriState constant specifying if to include leading zeros (Integer):
-1 = vbTrue
0 = vbFalse
1 = vbUseDefault
negativeuseparens(Optional) A vbTriState constant specifying how to display negative numbers (Integer):
-1 = vbTrue
0 = vbFalse
1 = vbUseDefault
groupdigits(Optional) A vbTriState constant specifying if numbers are grouped (Integer):
-1 = vbTrue
0 = vbFalse
1 = vbUseDefault

REMARKS
* If "numdigitsafter" is left blank, then it is assumed to be -1.
* If "includeleadingdigit" is left blank, then vbTrue is used.
* If "negativeuseparens" is left blank, then vbFalse is used.
* If "groupdigits" is left blank, then ??
* When one or more optional arguments are omitted, the 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.
* All settings information comes from the Regional Settings Currency tab, except leading zero which comes from the Number tab.
* The currency symbol used corresponds to that defined in the system control panel.
* This function was added in Office 2000.
* The equivalent .NET function is Microsoft.VisualBasic.Strings.FormatCurrency
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print FormatCurrency(200) 
Debug.Print FormatCurrency(200, 3)
Debug.Print FormatCurrency(0.56, 3, vbFalse)
Debug.Print FormatCurrency(0.56, 3, vbTrue)
Debug.Print FormatCurrency(-0.56, , , vbTrue)

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top