DecimalFormat.ApplyPattern(String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將給定的模式套用到這個格式物件上。
[Android.Runtime.Register("applyPattern", "(Ljava/lang/String;)V", "GetApplyPattern_Ljava_lang_String_Handler")]
public virtual void ApplyPattern(string? pattern);
[<Android.Runtime.Register("applyPattern", "(Ljava/lang/String;)V", "GetApplyPattern_Ljava_lang_String_Handler")>]
abstract member ApplyPattern : string -> unit
override this.ApplyPattern : string -> unit
參數
- pattern
- String
一個新的模式
- 屬性
例外狀況
如果無法解析該模式。
備註
將給定的模式套用到這個格式物件上。 模式是一種簡寫的規範,描述各種格式屬性。 這些屬性也可以透過各種二傳方法個別調整。
此例程對整數數字沒有限制,因為這是終端使用者的典型需求;如果你想設定實值,可以使用 setMaximumInteger。 對於負數,則使用第二種模式,中間用分號分隔
範例 "#,#00.0#" → 1,234.56
這表示至少有2位整數位數、1位小數位數,最多2位小數位數。
範例: "#,#00.0#;(#,#00.0#)" 括號內的負片。
在負型態中,忽略最小與最大計數;這些被假設為正向模式。
Java 文件 java.text.DecimalFormat.applyPattern(java.lang.String)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。