NumberFormatInfo.PercentSymbol 屬性

定義

取得或設定要當做百分比符號的字串。Gets or sets the string to use as the percent symbol.

public:
 property System::String ^ PercentSymbol { System::String ^ get(); void set(System::String ^ value); };
public string PercentSymbol { get; set; }
member this.PercentSymbol : string with get, set
Public Property PercentSymbol As String

屬性值

要當做百分比符號的字串。The string to use as the percent symbol. InvariantInfo 的預設值為 "%"。The default for InvariantInfo is "%".

例外狀況

正在將屬性設定為 nullThe property is being set to null.

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

備註

當數值的格式為PercentSymbol "P",或格式字串包含 "%" 時,指派給屬性的字串會包含在結果字串中。The string assigned to the PercentSymbol property is included in the result string when a numeric value is formatted with the "P" or with a format string that includes the "%" .

適用於

另請參閱