Share via


LocalizedNumberFormatter.Format Method

Definition

Overloads

Format(Measure)

Format the given Measure or CurrencyAmount to a string using the settings specified in the NumberFormatter fluent setting chain.

Format(Number)

Format the given BigInteger, BigDecimal, or other Number to a string using the settings specified in the NumberFormatter fluent setting chain.

Format(Double)

Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting chain.

Format(Int64)

Format the given byte, short, int, or long to a string using the settings specified in the NumberFormatter fluent setting chain.

Format(Measure)

Format the given Measure or CurrencyAmount to a string using the settings specified in the NumberFormatter fluent setting chain.

[Android.Runtime.Register("format", "(Landroid/icu/util/Measure;)Landroid/icu/number/FormattedNumber;", "GetFormat_Landroid_icu_util_Measure_Handler", ApiSince=30)]
public virtual Android.Icu.Number.FormattedNumber? Format (Android.Icu.Util.Measure? input);
[<Android.Runtime.Register("format", "(Landroid/icu/util/Measure;)Landroid/icu/number/FormattedNumber;", "GetFormat_Landroid_icu_util_Measure_Handler", ApiSince=30)>]
abstract member Format : Android.Icu.Util.Measure -> Android.Icu.Number.FormattedNumber
override this.Format : Android.Icu.Util.Measure -> Android.Icu.Number.FormattedNumber

Parameters

input
Measure

The number to format.

Returns

A FormattedNumber object; call .toString() to get the string.

Attributes

Remarks

Format the given Measure or CurrencyAmount to a string using the settings specified in the NumberFormatter fluent setting chain.

The unit specified here overrides any unit that may have been specified in the setter chain. This method is intended for cases when each input to the number formatter has a different unit.

Java documentation for android.icu.number.LocalizedNumberFormatter.format(android.icu.util.Measure).

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(Number)

Format the given BigInteger, BigDecimal, or other Number to a string using the settings specified in the NumberFormatter fluent setting chain.

[Android.Runtime.Register("format", "(Ljava/lang/Number;)Landroid/icu/number/FormattedNumber;", "GetFormat_Ljava_lang_Number_Handler", ApiSince=30)]
public virtual Android.Icu.Number.FormattedNumber? Format (Java.Lang.Number? input);
[<Android.Runtime.Register("format", "(Ljava/lang/Number;)Landroid/icu/number/FormattedNumber;", "GetFormat_Ljava_lang_Number_Handler", ApiSince=30)>]
abstract member Format : Java.Lang.Number -> Android.Icu.Number.FormattedNumber
override this.Format : Java.Lang.Number -> Android.Icu.Number.FormattedNumber

Parameters

input
Number

The number to format.

Returns

A FormattedNumber object; call .toString() to get the string.

Attributes

Remarks

Format the given BigInteger, BigDecimal, or other Number to a string using the settings specified in the NumberFormatter fluent setting chain.

Java documentation for android.icu.number.LocalizedNumberFormatter.format(java.lang.Number).

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)

Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting chain.

[Android.Runtime.Register("format", "(D)Landroid/icu/number/FormattedNumber;", "GetFormat_DHandler", ApiSince=30)]
public virtual Android.Icu.Number.FormattedNumber? Format (double input);
[<Android.Runtime.Register("format", "(D)Landroid/icu/number/FormattedNumber;", "GetFormat_DHandler", ApiSince=30)>]
abstract member Format : double -> Android.Icu.Number.FormattedNumber
override this.Format : double -> Android.Icu.Number.FormattedNumber

Parameters

input
Double

The number to format.

Returns

A FormattedNumber object; call .toString() to get the string.

Attributes

Remarks

Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting chain.

Java documentation for android.icu.number.LocalizedNumberFormatter.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(Int64)

Format the given byte, short, int, or long to a string using the settings specified in the NumberFormatter fluent setting chain.

[Android.Runtime.Register("format", "(J)Landroid/icu/number/FormattedNumber;", "GetFormat_JHandler", ApiSince=30)]
public virtual Android.Icu.Number.FormattedNumber? Format (long input);
[<Android.Runtime.Register("format", "(J)Landroid/icu/number/FormattedNumber;", "GetFormat_JHandler", ApiSince=30)>]
abstract member Format : int64 -> Android.Icu.Number.FormattedNumber
override this.Format : int64 -> Android.Icu.Number.FormattedNumber

Parameters

input
Int64

The number to format.

Returns

A FormattedNumber object; call .toString() to get the string.

Attributes

Remarks

Format the given byte, short, int, or long to a string using the settings specified in the NumberFormatter fluent setting chain.

Java documentation for android.icu.number.LocalizedNumberFormatter.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.

Applies to