NumberFormat.Format Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Format(Int64, StringBuffer, FieldPosition) |
Specialization of format. |
| Format(Double, StringBuffer, FieldPosition) |
Specialization of format. |
| Format(BigInteger, StringBuffer, FieldPosition) |
<strong>[icu]</strong> Formats a BigInteger. |
| Format(Object, StringBuffer, FieldPosition) |
Formats a number and appends the resulting text to the given string buffer. |
| Format(CurrencyAmount, StringBuffer, FieldPosition) |
<strong>[icu]</strong> Formats a CurrencyAmount. |
| Format(BigDecimal, StringBuffer, FieldPosition) |
<strong>[icu]</strong> Formats an ICU BigDecimal. |
| Format(BigDecimal, StringBuffer, FieldPosition) |
<strong>[icu]</strong> Formats a BigDecimal. |
| Format(Double) |
Specialization of format. |
| Format(BigInteger) |
<strong>[icu]</strong> Convenience method to format a BigInteger. |
| Format(BigDecimal) |
Convenience method to format a BigDecimal. |
| Format(CurrencyAmount) |
<strong>[icu]</strong> Convenience method to format a CurrencyAmount. |
| Format(BigDecimal) |
<strong>[icu]</strong> Convenience method to format an ICU BigDecimal. |
| Format(Int64) |
Specialization of format. |
Format(Int64, StringBuffer, FieldPosition)
Specialization of format.
[Android.Runtime.Register("format", "(JLjava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_JLjava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public abstract Java.Lang.StringBuffer? Format(long number, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(JLjava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_JLjava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : int64 * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer
Parameters
- number
- Int64
The 64-bit integer to format.
- toAppendTo
- StringBuffer
The destination buffer to which the formatted value is appended.
- pos
- FieldPosition
Identifies the output field whose bounds are requested and receives those bounds when the field is present.
Returns
The toAppendTo buffer with the formatted integer value appended.
- Attributes
Remarks
Specialization of format.
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
Format(Double, StringBuffer, FieldPosition)
Specialization of format.
[Android.Runtime.Register("format", "(DLjava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_DLjava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public abstract Java.Lang.StringBuffer? Format(double number, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(DLjava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_DLjava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : double * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer
Parameters
- number
- Double
The floating-point value to format.
- toAppendTo
- StringBuffer
The destination buffer to which the formatted value is appended.
- pos
- FieldPosition
Identifies the output field whose bounds are requested and receives those bounds when the field is present.
Returns
The toAppendTo buffer with the formatted floating-point value appended.
- Attributes
Remarks
Specialization of format.
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
Format(BigInteger, StringBuffer, FieldPosition)
<strong>[icu]</strong> Formats a BigInteger.
[Android.Runtime.Register("format", "(Ljava/math/BigInteger;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_math_BigInteger_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public abstract Java.Lang.StringBuffer? Format(Java.Math.BigInteger? number, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Ljava/math/BigInteger;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_math_BigInteger_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : Java.Math.BigInteger * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer
Parameters
- number
- BigInteger
The arbitrary-precision integer to format.
- toAppendTo
- StringBuffer
The destination buffer to which the formatted value is appended.
- pos
- FieldPosition
Identifies the output field whose bounds are requested and receives those bounds when the field is present.
Returns
The toAppendTo buffer with the formatted integer value appended.
- Attributes
Remarks
<strong>[icu]</strong> Formats a BigInteger. Specialization of format.
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
Format(Object, StringBuffer, FieldPosition)
Formats a number and appends the resulting text to the given string buffer.
[Android.Runtime.Register("format", "(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_lang_Object_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public override Java.Lang.StringBuffer? Format(Java.Lang.Object? number, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Ljava/lang/Object;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_lang_Object_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : Java.Lang.Object * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer
Parameters
- number
- Object
The object to format
- toAppendTo
- StringBuffer
where the text is to be appended
- pos
- FieldPosition
A FieldPosition identifying a field in the formatted text
Returns
the string buffer passed in as toAppendTo, with formatted text appended
- Attributes
Remarks
Formats a number and appends the resulting text to the given string buffer. <strong>[icu] Note:</strong> recognizes BigInteger and BigDecimal objects.
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
Format(CurrencyAmount, StringBuffer, FieldPosition)
<strong>[icu]</strong> Formats a CurrencyAmount.
[Android.Runtime.Register("format", "(Landroid/icu/util/CurrencyAmount;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Landroid_icu_util_CurrencyAmount_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public virtual Java.Lang.StringBuffer? Format(Android.Icu.Util.CurrencyAmount? currAmt, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Landroid/icu/util/CurrencyAmount;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Landroid_icu_util_CurrencyAmount_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : Android.Icu.Util.CurrencyAmount * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer
Parameters
- currAmt
- CurrencyAmount
The numeric amount and its currency to format.
- toAppendTo
- StringBuffer
The destination buffer to which the formatted amount is appended.
- pos
- FieldPosition
Identifies the output field whose bounds are requested and receives those bounds when the field is present.
Returns
The toAppendTo buffer with the formatted currency amount appended.
- Attributes
Remarks
<strong>[icu]</strong> Formats a CurrencyAmount. Specialization of format.
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
Format(BigDecimal, StringBuffer, FieldPosition)
<strong>[icu]</strong> Formats an ICU BigDecimal.
[Android.Runtime.Register("format", "(Landroid/icu/math/BigDecimal;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Landroid_icu_math_BigDecimal_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public abstract Java.Lang.StringBuffer? Format(Android.Icu.Math.BigDecimal? number, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Landroid/icu/math/BigDecimal;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Landroid_icu_math_BigDecimal_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : Android.Icu.Math.BigDecimal * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer
Parameters
- number
- BigDecimal
The ICU decimal value to format.
- toAppendTo
- StringBuffer
The destination buffer to which the formatted value is appended.
- pos
- FieldPosition
Identifies the output field whose bounds are requested and receives those bounds when the field is present.
Returns
The toAppendTo buffer with the formatted decimal value appended.
- Attributes
Remarks
<strong>[icu]</strong> Formats an ICU BigDecimal. Specialization of format.
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
Format(BigDecimal, StringBuffer, FieldPosition)
<strong>[icu]</strong> Formats a BigDecimal.
[Android.Runtime.Register("format", "(Ljava/math/BigDecimal;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_math_BigDecimal_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)]
public abstract Java.Lang.StringBuffer? Format(Java.Math.BigDecimal? number, Java.Lang.StringBuffer? toAppendTo, Java.Text.FieldPosition? pos);
[<Android.Runtime.Register("format", "(Ljava/math/BigDecimal;Ljava/lang/StringBuffer;Ljava/text/FieldPosition;)Ljava/lang/StringBuffer;", "GetFormat_Ljava_math_BigDecimal_Ljava_lang_StringBuffer_Ljava_text_FieldPosition_Handler", ApiSince=24)>]
override this.Format : Java.Math.BigDecimal * Java.Lang.StringBuffer * Java.Text.FieldPosition -> Java.Lang.StringBuffer
Parameters
- number
- BigDecimal
The Java decimal value to format.
- toAppendTo
- StringBuffer
The destination buffer to which the formatted value is appended.
- pos
- FieldPosition
Identifies the output field whose bounds are requested and receives those bounds when the field is present.
Returns
The toAppendTo buffer with the formatted decimal value appended.
- Attributes
Remarks
<strong>[icu]</strong> Formats a BigDecimal. Specialization of format.
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
Format(Double)
Specialization of format.
[Android.Runtime.Register("format", "(D)Ljava/lang/String;", "", ApiSince=24)]
public string? Format(double number);
[<Android.Runtime.Register("format", "(D)Ljava/lang/String;", "", ApiSince=24)>]
override this.Format : double -> string
Parameters
- number
- Double
The floating-point value to format using this instance's settings.
Returns
The formatted floating-point value as a string.
- Attributes
Remarks
Specialization of format.
Java documentation for android.icu.text.NumberFormat.format(double).
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
Format(BigInteger)
<strong>[icu]</strong> Convenience method to format a BigInteger.
[Android.Runtime.Register("format", "(Ljava/math/BigInteger;)Ljava/lang/String;", "", ApiSince=24)]
public string? Format(Java.Math.BigInteger? number);
[<Android.Runtime.Register("format", "(Ljava/math/BigInteger;)Ljava/lang/String;", "", ApiSince=24)>]
override this.Format : Java.Math.BigInteger -> string
Parameters
- number
- BigInteger
The arbitrary-precision integer to format using this instance's settings.
Returns
The formatted integer value as a string.
- Attributes
Remarks
<strong>[icu]</strong> Convenience method to format a BigInteger.
Java documentation for android.icu.text.NumberFormat.format(java.math.BigInteger).
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
Format(BigDecimal)
Convenience method to format a BigDecimal.
[Android.Runtime.Register("format", "(Ljava/math/BigDecimal;)Ljava/lang/String;", "", ApiSince=24)]
public string? Format(Java.Math.BigDecimal? number);
[<Android.Runtime.Register("format", "(Ljava/math/BigDecimal;)Ljava/lang/String;", "", ApiSince=24)>]
override this.Format : Java.Math.BigDecimal -> string
Parameters
- number
- BigDecimal
The Java decimal value to format using this instance's settings.
Returns
The formatted decimal value as a string.
- Attributes
Remarks
Convenience method to format a BigDecimal.
Java documentation for android.icu.text.NumberFormat.format(java.math.BigDecimal).
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
Format(CurrencyAmount)
<strong>[icu]</strong> Convenience method to format a CurrencyAmount.
[Android.Runtime.Register("format", "(Landroid/icu/util/CurrencyAmount;)Ljava/lang/String;", "", ApiSince=24)]
public string? Format(Android.Icu.Util.CurrencyAmount? currAmt);
[<Android.Runtime.Register("format", "(Landroid/icu/util/CurrencyAmount;)Ljava/lang/String;", "", ApiSince=24)>]
override this.Format : Android.Icu.Util.CurrencyAmount -> string
Parameters
- currAmt
- CurrencyAmount
The numeric amount and its currency to format.
Returns
The amount formatted with its associated currency.
- Attributes
Remarks
<strong>[icu]</strong> Convenience method to format a CurrencyAmount.
Java documentation for android.icu.text.NumberFormat.format(android.icu.util.CurrencyAmount).
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
Format(BigDecimal)
<strong>[icu]</strong> Convenience method to format an ICU BigDecimal.
[Android.Runtime.Register("format", "(Landroid/icu/math/BigDecimal;)Ljava/lang/String;", "", ApiSince=24)]
public string? Format(Android.Icu.Math.BigDecimal? number);
[<Android.Runtime.Register("format", "(Landroid/icu/math/BigDecimal;)Ljava/lang/String;", "", ApiSince=24)>]
override this.Format : Android.Icu.Math.BigDecimal -> string
Parameters
- number
- BigDecimal
The ICU decimal value to format using this instance's settings.
Returns
The formatted decimal value as a string.
- Attributes
Remarks
<strong>[icu]</strong> Convenience method to format an ICU BigDecimal.
Java documentation for android.icu.text.NumberFormat.format(android.icu.math.BigDecimal).
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
Format(Int64)
Specialization of format.
[Android.Runtime.Register("format", "(J)Ljava/lang/String;", "", ApiSince=24)]
public string? Format(long number);
[<Android.Runtime.Register("format", "(J)Ljava/lang/String;", "", ApiSince=24)>]
override this.Format : int64 -> string
Parameters
- number
- Int64
The 64-bit integer to format using this instance's settings.
Returns
The formatted integer value as a string.
- Attributes
Remarks
Specialization of format.
Java documentation for android.icu.text.NumberFormat.format(long).
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.