NumberFormatInfo.PercentNegativePattern 屬性

定義

取得或設定負數百分比值的格式模式。

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

屬性值

負數百分比值的格式模式。 InvariantInfo 的預設值為 0,代表 "-n %",其中 "%" 為 PercentSymbol,而 n 為數值。

例外狀況

屬性已設定為小於 0 或大於 11 的值。

正在設定屬性,而且 NumberFormatInfo 物件為唯讀。

備註

屬性 PercentNegativePattern 會與 「P」 標準格式字串搭配使用,以定義負百分比值的模式。 如需詳細資訊,請參閱標準數值格式字串。 這個屬性具有下表中的其中一個值。 符號 「%」 是 PercentSymbol ,符號 「-」 是 NegativeSign ,而 n 是數位。 值 3-11 是在 .NET Framework 2.0 中引進,無法在舊版中使用。

相關聯的模式
0 -n %
1 -n%
2 -%n
3 %-n
4 %n-
5 n-%
6 n%-
7 -% n
8 n %-
9 % n-
10 % -n
11 n- %

適用於

另請參閱