# FormatPercent 函数FormatPercent function

## 语法Syntax

FormatPercent(Expression、[ NumDigitsAfterDecimal, [ IncludeLeadingDigit, [ UseParensForNegativeNumbers, [ GroupDigits ]]]])FormatPercent(Expression, [ NumDigitsAfterDecimal, [ IncludeLeadingDigit, [ UseParensForNegativeNumbers, [ GroupDigits ]]]])

FormatPercent 函数的语法包含以下部分：The FormatPercent function syntax has these parts:

PartPart 说明Description
ExpressionExpression 必需。Required. 要格式化的表达式。Expression to be formatted.
NumDigitsAfterDecimalNumDigitsAfterDecimal 可选。Optional. 指示要显示的小数点右侧的位数的数值。Numeric value indicating how many places to the right of the decimal are displayed. 默认值为-1, 表示使用计算机的区域设置。Default value is -1, which indicates that the computer's regional settings are used.
IncludeLeadingDigitIncludeLeadingDigit 可选。Optional. 指示是否为小数值显示前导零的三态常数。Tristate constant that indicates whether or not a leading zero is displayed for fractional values. 请参阅“设置”部分以了解各个值。See Settings section for values.
UseParensForNegativeNumbersUseParensForNegativeNumbers 可选。Optional. 指示是否在圆括号内放置负值的三态常数。Tristate constant that indicates whether or not to place negative values within parentheses. 请参阅“设置”部分以了解各个值。See Settings section for values.
GroupDigitsGroupDigits 可选。Optional. 三态常量, 指示是否使用计算机的区域设置中指定的组分隔符对数字进行分组。Tristate constant that indicates whether or not numbers are grouped by using the group delimiter specified in the computer's regional settings. 请参阅“设置”部分以了解各个值。See Settings section for values.

## 设置Settings

vbTruevbTrue -1-1 TrueTrue
vbFalsevbFalse 00 FalseFalse
vbUseDefaultvbUseDefault -2-2 使用计算机的区域设置中的设置。Use the setting from the computer's regional settings.