Språk

DecimalFormat.ApplyPattern(String) Method

Definition

Parses the given pattern string and overwrites the settings specified in the pattern string.

[Android.Runtime.Register("applyPattern", "(Ljava/lang/String;)V", "GetApplyPattern_Ljava_lang_String_Handler", ApiSince=24)]
public virtual void ApplyPattern(string? pattern);
[<Android.Runtime.Register("applyPattern", "(Ljava/lang/String;)V", "GetApplyPattern_Ljava_lang_String_Handler", ApiSince=24)>]
abstract member ApplyPattern : string -> unit
override this.ApplyPattern : string -> unit

Parameters

pattern
String

The nonlocalized decimal pattern to parse into formatter settings.

Attributes

Remarks

Parses the given pattern string and overwrites the settings specified in the pattern string. The properties corresponding to the following setters are overwritten, either with their default values or with the value specified in the pattern string:

  1. #setDecimalSeparatorAlwaysShown
  2. #setExponentSignAlwaysShown
  3. #setFormatWidth
  4. #setGroupingSize
  5. #setMultiplier (percent/permille)
  6. #setMaximumFractionDigits
  7. #setMaximumIntegerDigits
  8. #setMaximumSignificantDigits
  9. #setMinimumExponentDigits
  10. #setMinimumFractionDigits
  11. #setMinimumIntegerDigits
  12. #setMinimumSignificantDigits
  13. #setPadPosition
  14. #setPadCharacter
  15. #setRoundingIncrement
  16. #setSecondaryGroupingSize

All other settings remain untouched.

For more information on pattern strings, see UTS #35.

Java documentation for android.icu.text.DecimalFormat.applyPattern(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to