다음을 통해 공유


DecimalFormat Constructors

Definition

Overloads

DecimalFormat()

Creates a DecimalFormat based on the number pattern and symbols for the default locale.

DecimalFormat(String)

Creates a DecimalFormat based on the given pattern, using symbols for the default locale.

DecimalFormat(IntPtr, JniHandleOwnership)
DecimalFormat(String, DecimalFormatSymbols)

Creates a DecimalFormat based on the given pattern and symbols.

DecimalFormat(String, DecimalFormatSymbols, CurrencyPluralInfo, NumberFormatStyles)

Creates a DecimalFormat based on the given pattern and symbols, with additional control over the behavior of currency.

DecimalFormat()

Creates a DecimalFormat based on the number pattern and symbols for the default locale.

[Android.Runtime.Register(".ctor", "()V", "", ApiSince=24)]
public DecimalFormat ();
Attributes

Remarks

Creates a DecimalFormat based on the number pattern and symbols for the default locale. This is a convenient way to obtain a DecimalFormat instance when internationalization is not the main concern.

Most users should call the factory methods on NumberFormat, such as NumberFormat#getNumberInstance, which return localized formatter objects, instead of the DecimalFormat constructors.

Java documentation for android.icu.text.DecimalFormat.DecimalFormat().

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

DecimalFormat(String)

Creates a DecimalFormat based on the given pattern, using symbols for the default locale.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "", ApiSince=24)]
public DecimalFormat (string? pattern);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "", ApiSince=24)>]
new Android.Icu.Text.DecimalFormat : string -> Android.Icu.Text.DecimalFormat

Parameters

pattern
String

A pattern string such as "#,##0.00" conforming to UTS #35.

Attributes

Remarks

Creates a DecimalFormat based on the given pattern, using symbols for the default locale. This is a convenient way to obtain a DecimalFormat instance when internationalization is not the main concern.

Most users should call the factory methods on NumberFormat, such as NumberFormat#getNumberInstance, which return localized formatter objects, instead of the DecimalFormat constructors.

Java documentation for android.icu.text.DecimalFormat.DecimalFormat(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

DecimalFormat(IntPtr, JniHandleOwnership)

protected DecimalFormat (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Icu.Text.DecimalFormat : nativeint * Android.Runtime.JniHandleOwnership -> Android.Icu.Text.DecimalFormat

Parameters

javaReference
IntPtr

nativeint

Remarks

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

DecimalFormat(String, DecimalFormatSymbols)

Creates a DecimalFormat based on the given pattern and symbols.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Landroid/icu/text/DecimalFormatSymbols;)V", "", ApiSince=24)]
public DecimalFormat (string? pattern, Android.Icu.Text.DecimalFormatSymbols? symbols);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Landroid/icu/text/DecimalFormatSymbols;)V", "", ApiSince=24)>]
new Android.Icu.Text.DecimalFormat : string * Android.Icu.Text.DecimalFormatSymbols -> Android.Icu.Text.DecimalFormat

Parameters

pattern
String

A pattern string such as "#,##0.00" conforming to UTS #35.

symbols
DecimalFormatSymbols

The set of symbols to be used.

Attributes

Remarks

Creates a DecimalFormat based on the given pattern and symbols. Use this constructor if you want complete control over the behavior of the formatter.

Most users should call the factory methods on NumberFormat, such as NumberFormat#getNumberInstance, which return localized formatter objects, instead of the DecimalFormat constructors.

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

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

DecimalFormat(String, DecimalFormatSymbols, CurrencyPluralInfo, NumberFormatStyles)

Creates a DecimalFormat based on the given pattern and symbols, with additional control over the behavior of currency.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Landroid/icu/text/DecimalFormatSymbols;Landroid/icu/text/CurrencyPluralInfo;I)V", "", ApiSince=24)]
public DecimalFormat (string? pattern, Android.Icu.Text.DecimalFormatSymbols? symbols, Android.Icu.Text.CurrencyPluralInfo? infoInput, Android.Icu.Text.NumberFormatStyles style);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Landroid/icu/text/DecimalFormatSymbols;Landroid/icu/text/CurrencyPluralInfo;I)V", "", ApiSince=24)>]
new Android.Icu.Text.DecimalFormat : string * Android.Icu.Text.DecimalFormatSymbols * Android.Icu.Text.CurrencyPluralInfo * Android.Icu.Text.NumberFormatStyles -> Android.Icu.Text.DecimalFormat

Parameters

pattern
String

a non-localized pattern string

symbols
DecimalFormatSymbols

the set of symbols to be used

infoInput
CurrencyPluralInfo

the information used for currency plural format, including currency plural patterns and plural rules.

style
NumberFormatStyles

the decimal formatting style, it is one of the following values: NumberFormat.NUMBERSTYLE; NumberFormat.CURRENCYSTYLE; NumberFormat.PERCENTSTYLE; NumberFormat.SCIENTIFICSTYLE; NumberFormat.INTEGERSTYLE; NumberFormat.ISOCURRENCYSTYLE; NumberFormat.PLURALCURRENCYSTYLE;

Attributes

Remarks

Creates a DecimalFormat based on the given pattern and symbols, with additional control over the behavior of currency. The style argument determines whether currency rounding rules should override the pattern, and the CurrencyPluralInfo object is used for customizing the plural forms used for currency long names.

Most users should call the factory methods on NumberFormat, such as NumberFormat#getNumberInstance, which return localized formatter objects, instead of the DecimalFormat constructors.

Java documentation for android.icu.text.DecimalFormat.DecimalFormat(java.lang.String, android.icu.text.DecimalFormatSymbols, android.icu.text.CurrencyPluralInfo, int).

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