NumberFormatInfo.PercentNegativePattern 屬性

定義

取得或設定負數百分比值的格式模式。Gets or sets the format pattern for negative percent values.

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

屬性值

負數百分比值的格式模式。The format pattern for negative percent values. InvariantInfo 的預設值為 0,代表 "-n %",其中 "%" 為 PercentSymbol,而 n 為數值。The default for InvariantInfo is 0, which represents "-n %", where "%" is the PercentSymbol and n is a number.

例外狀況

屬性已設定為小於 0 或大於 11 的值。The property is being set to a value that is less than 0 or greater than 11.

正在設定屬性,而且 NumberFormatInfo 物件為唯讀。The property is being set and the NumberFormatInfo object is read-only.

備註

PercentNegativePattern屬性會與 "P" 標準格式字串搭配使用,以定義負百分比值的模式。The PercentNegativePattern property is used with the "P" standard format string to define the pattern of negative percentage values. 如需詳細資訊,請參閱標準數值格式字串For more information, see Standard Numeric Format Strings. 此屬性具有下表中的其中一個值。This property has one of the values in the following table. 符號 "%" 為PercentSymbol,符號 "-" NegativeSign為,而n為數字。The symbol "%" is the PercentSymbol, the symbol "-" is the NegativeSign, and n is a number. 值3-11 是在 .NET Framework 2.0 中引進,無法在舊版中使用。Values 3-11 were introduced in the .NET Framework 2.0 and cannot be used in earlier versions.

Value 關聯的模式Associated pattern
00 -n %-n %
11 -n%-n%
22 -%n-%n
33 %-n%-n
44 %n-
55 n-%n-%
66 n%-n%-
77 -% n-% n
88 n %-n %-
99 % n-
1010 %-n% -n
1111 n-%n- %

適用於

另請參閱