Język

Precision.Currency(Currency+CurrencyUsage) Method

Definition

Show numbers rounded and padded according to the rules for the currency unit.

[Android.Runtime.Register("currency", "(Landroid/icu/util/Currency$CurrencyUsage;)Landroid/icu/number/CurrencyPrecision;", "", ApiSince=30)]
public static Android.Icu.Number.CurrencyPrecision? Currency(Android.Icu.Util.Currency.CurrencyUsage? currencyUsage);
[<Android.Runtime.Register("currency", "(Landroid/icu/util/Currency$CurrencyUsage;)Landroid/icu/number/CurrencyPrecision;", "", ApiSince=30)>]
static member Currency : Android.Icu.Util.Currency.CurrencyUsage -> Android.Icu.Number.CurrencyPrecision

Parameters

currencyUsage
Currency.CurrencyUsage

Either STANDARD (for digital transactions) or CASH (for transactions where the rounding increment may be limited by the available denominations of cash or coins).

Returns

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

Attributes

Remarks

Show numbers rounded and padded according to the rules for the currency unit. The most common rounding precision settings for currencies include Precision.fixedFraction(2), Precision.integer(), and Precision.increment(0.05) for cash transactions ("nickel rounding").

The exact rounding details will be resolved at runtime based on the currency unit specified in the NumberFormatter chain. To round according to the rules for one currency while displaying the symbol for another currency, the withCurrency() method can be called on the return value of this method.

Android reference for android.icu.number.Precision.currency.

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