Partager via


FractionPrecision.WithMinDigits(Int32) Method

Definition

Ensure that no less than this number of significant digits are retained when rounding according to fraction rules.

[Android.Runtime.Register("withMinDigits", "(I)Landroid/icu/number/Precision;", "GetWithMinDigits_IHandler", ApiSince=30)]
public virtual Android.Icu.Number.Precision? WithMinDigits (int minSignificantDigits);
[<Android.Runtime.Register("withMinDigits", "(I)Landroid/icu/number/Precision;", "GetWithMinDigits_IHandler", ApiSince=30)>]
abstract member WithMinDigits : int -> Android.Icu.Number.Precision
override this.WithMinDigits : int -> Android.Icu.Number.Precision

Parameters

minSignificantDigits
Int32

The number of significant figures to guarantee.

Returns

A Precision for chaining or passing to the NumberFormatter rounding() setter.

Attributes

Remarks

Ensure that no less than this number of significant digits are retained when rounding according to fraction rules.

For example, with integer rounding, the number 3.141 becomes "3". However, with minimum figures set to 2, 3.141 becomes "3.1" instead.

This setting does not affect the number of trailing zeros. For example, 3.01 would print as "3", not "3.0".

This is equivalent to withSignificantDigits(1, minSignificantDigits, RELAXED).

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