DecimalFormat Constructors

Definition

Overloads

DecimalFormat()

Creates a DecimalFormat using the default pattern and symbols for the default java.util.Locale.Category#FORMAT FORMAT locale.

DecimalFormat(String)

Creates a DecimalFormat using the given pattern and the symbols for the default java.util.Locale.Category#FORMAT FORMAT locale.

DecimalFormat(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

DecimalFormat(String, DecimalFormatSymbols)

Creates a DecimalFormat using the given pattern and symbols.

DecimalFormat()

Creates a DecimalFormat using the default pattern and symbols for the default java.util.Locale.Category#FORMAT FORMAT locale.

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

Remarks

Creates a DecimalFormat using the default pattern and symbols for the default java.util.Locale.Category#FORMAT FORMAT locale. This is a convenient way to obtain a DecimalFormat when internationalization is not the main concern.

To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getNumberInstance. These factories will return the most appropriate sub-class of NumberFormat for a given locale.

Java documentation for java.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 using the given pattern and the symbols for the default java.util.Locale.Category#FORMAT FORMAT locale.

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

Parameters

pattern
String

a non-localized pattern string.

Attributes

Exceptions

if the pattern cannot be parsed.

Remarks

Creates a DecimalFormat using the given pattern and the symbols for the default java.util.Locale.Category#FORMAT FORMAT locale. This is a convenient way to obtain a DecimalFormat when internationalization is not the main concern.

To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getNumberInstance. These factories will return the most appropriate sub-class of NumberFormat for a given locale.

Java documentation for java.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)

A constructor used when creating managed representations of JNI objects; called by the runtime.

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

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

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 using the given pattern and symbols.

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

Parameters

pattern
String

a non-localized pattern string

symbols
DecimalFormatSymbols

the set of symbols to be used

Attributes

Exceptions

if the pattern cannot be parsed.

Remarks

Creates a DecimalFormat using the given pattern and symbols. Use this constructor when you need to completely customize the behavior of the format.

To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getInstance or getCurrencyInstance. If you need only minor adjustments to a standard format, you can modify the format returned by a NumberFormat factory method.

Java documentation for java.text.DecimalFormat.DecimalFormat(java.lang.String, java.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