6.1.2.11.1.13 FormatPercent

Function Declaration

 Function FormatPercent(Expression, Optional 
 NumDigitsAfterDecimal As Long = -1, Optional 
 IncludeLeadingDigit As VbTriState = vbUseDefault, Optional 
 UseParensForNegativeNumbers As VbTriState = vbUseDefault, 
 Optional GroupDigits As VbTriState = vbUseDefault) As String 

Parameter

Description

Expression

Variant containing the expression to be formatted.

NumDigitsAfterDecimal

Numeric value indicating how many places to the right of the decimal are displayed. Default value is 1, which indicates that implementation-defined settings are used.

IncludeLeadingDigit

Tristate constant that indicates whether or not a leading zero is displayed for fractional values. See the next table in this section for values.

UseParensForNegativeNumbers

Tristate constant that indicates whether or not to place negative values within parentheses. See the next table in this section for values.

GroupDigits

Tristate constant that indicates whether or not numbers are grouped using the implementation-defined group delimiter. See the next table in this section for values.

Runtime Semantics.

§ Returns an expression formatted as a percentage (multiplied by 100) with a trailing % character.

§ The IncludeLeadingDigit, UseParensForNegativeNumbers, and GroupDigits arguments have the following settings:

Constant

Value

Description

vbTrue

1

True

vbFalse

0

False

vbUseDefault

2

Use the setting from the computer's regional settings.

§ When one or more optional arguments are omitted, the values for omitted arguments are implementation-defined.