NumberFormatInfo.PercentPositivePattern 属性


获取或设置正百分比值的格式模式。Gets or sets the format pattern for positive percent values.

 property int PercentPositivePattern { int get(); void set(int value); };
public int PercentPositivePattern { get; set; }
member this.PercentPositivePattern : int with get, set
Public Property PercentPositivePattern As Integer


正百分比值的格式模式。The format pattern for positive percent values. InvariantInfo 的默认值是 0,它表示“n %”,其中“%”是 PercentSymboln 是一个数字。The default for InvariantInfo is 0, which represents "n %", where "%" is the PercentSymbol and n is a number.


该属性设置为一个小于 0 或大于 3 的值。The property is being set to a value that is less than 0 or greater than 3.

设置了该属性,但 NumberFormatInfo 对象为只读。The property is being set and the NumberFormatInfo object is read-only.


PercentPositivePattern属性与 "P" 标准格式字符串一起使用,定义正百分比值的模式。The PercentPositivePattern property is used with the "P" standard format string to define pattern of positive percentage values. 有关详细信息,请参阅标准数值格式字符串For more information, see Standard Numeric Format Strings. 此属性具有下表中的值之一。This property has one of the values in the following table. 符号 "%" 是PercentSymboln是一个数字。The symbol "%" is the PercentSymbol and n is a number.

Value 关联模式Associated pattern
00 n %n %
11 n%n%
22 % n%n
33 % n% n