public abstract class CurrencyPrecision extends Precision
To create a CurrencyPrecision, use one of the factory methods on Precision.
NumberFormatter
Precision.BogusRounder
BOGUS_PRECISION
Modifier and Type | Method and Description |
---|---|
Precision |
withCurrency(Currency currency)
Associates a currency with this rounding strategy.
|
apply, currency, fixedFraction, fixedSignificantDigits, increment, integer, maxFraction, maxSignificantDigits, minFraction, minMaxFraction, minMaxSignificantDigits, minSignificantDigits, trailingZeroDisplay, unlimited, withMode
public Precision withCurrency(Currency currency)
Calling this method is not required, because the currency specified in unit() or via a CurrencyAmount passed into format(Measure) is automatically applied to currency rounding strategies. However, this method enables you to override that automatic association.
This method also enables numbers to be formatted using currency rounding rules without explicitly using a currency format.
currency
- The currency to associate with this rounding strategy.IllegalArgumentException
- for null CurrencyNumberFormatter
Copyright © 2016 Unicode, Inc. and others.