Freigeben über


NumberFormatterSettings.Scale(Scale) Method

Definition

Sets a scale (multiplier) to be used to scale the number by an arbitrary amount before formatting.

[Android.Runtime.Register("scale", "(Landroid/icu/number/Scale;)Landroid/icu/number/NumberFormatterSettings;", "GetScale_Landroid_icu_number_Scale_Handler", ApiSince=30)]
public virtual Java.Lang.Object? Scale (Android.Icu.Number.Scale? scale);
[<Android.Runtime.Register("scale", "(Landroid/icu/number/Scale;)Landroid/icu/number/NumberFormatterSettings;", "GetScale_Landroid_icu_number_Scale_Handler", ApiSince=30)>]
abstract member Scale : Android.Icu.Number.Scale -> Java.Lang.Object
override this.Scale : Android.Icu.Number.Scale -> Java.Lang.Object

Parameters

scale
Scale

An amount to be multiplied against numbers before formatting.

Returns

The fluent chain

Attributes

Remarks

Sets a scale (multiplier) to be used to scale the number by an arbitrary amount before formatting. Most common values:

<ul> <li>Multiply by 100: useful for percentages. <li>Multiply by an arbitrary value: useful for unit conversions. </ul>

Pass an element from a Scale factory method to this setter. For example:

NumberFormatter.with().scale(Scale.powerOfTen(2))

The default is to not apply any multiplier.

Java documentation for android.icu.number.NumberFormatterSettings.scale(android.icu.number.Scale).

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