Freigeben über


Precision.FixedFraction(Int32) Method

Definition

Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator).

[Android.Runtime.Register("fixedFraction", "(I)Landroid/icu/number/FractionPrecision;", "", ApiSince=30)]
public static Android.Icu.Number.FractionPrecision? FixedFraction (int minMaxFractionPlaces);
[<Android.Runtime.Register("fixedFraction", "(I)Landroid/icu/number/FractionPrecision;", "", ApiSince=30)>]
static member FixedFraction : int -> Android.Icu.Number.FractionPrecision

Parameters

minMaxFractionPlaces
Int32

The minimum and maximum number of numerals to display after the decimal separator (rounding if too long or padding with zeros if too short).

Returns

A FractionPrecision for chaining or passing to the NumberFormatter precision() setter.

Attributes

Remarks

Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator). Additionally, pad with zeros to ensure that this number of places are always shown.

Example output with minMaxFractionPlaces = 3:

87,650.000<br> 8,765.000<br> 876.500<br> 87.650<br> 8.765<br> 0.876<br> 0.088<br> 0.009<br> 0.000 (zero)

This method is equivalent to #minMaxFraction with both arguments equal.

Java documentation for android.icu.number.Precision.fixedFraction(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