Name
FormatCurrency, FormatNumber, FormatPercent Functions
Class
Microsoft. VisualBasic. Strings
Syntax
FormatCurrency(expression[,NumDigitsAfterDecimal][, _IncludeLeadingDigit[,UseParensForNegativeNumbers[, _GroupDigits]]]]) FormatNumber(expression[,NumDigitsAfterDecimal][, _IncludeLeadingDigit[,UseParensForNegativeNumbers[, _GroupDigits]]]]) FormatPercent(expression[,NumDigitsAfterDecimal][, _IncludeLeadingDigit[,UseParensForNegativeNumbers[, _GroupDigits]]]])
-
expression Use: Required
Data Type: Object
The number or numeric expression to be formatted.
-
NumDigitsAfterDecimal Use: Optional
Data Type: Long
The number of digits the formatted string should contain after the decimal point.
-
IncludeLeadingDigit Use: Optional
Data Type:
TriStateconstantIndicates whether the formatted string is to have a 0 before floating point numbers between 1 and -1.
-
UseParensForNegativeNumbers Use: Optional
Data Type:
TriStateconstantSpecifies whether parentheses should be placed around negative numbers.
-
GroupDigits Use: Optional
Data Type:
TriStateconstantDetermines whether digits in the returned string should be grouped using the delimiter specified in the computer’s regional settings. For example, on English language systems, the value 1000000 is returned as 1,000,000 if
GroupDigitsisTrue.
Return Value
String
Description
Functions used to format currency, numbers, and percentages.
The three functions are almost identical. They all take identical
arguments. The only difference is that
FormatCurrency ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access