Package com.ibm.icu.number
Class CurrencyRounder
- java.lang.Object
-
- com.ibm.icu.number.Rounder
-
- com.ibm.icu.number.CurrencyRounder
-
- All Implemented Interfaces:
java.lang.Cloneable
public abstract class CurrencyRounder extends Rounder
A class that defines a rounding strategy parameterized by a currency to be used when formatting numbers in NumberFormatter.To create a CurrencyRounder, use one of the factory methods on Rounder.
- See Also:
NumberFormatter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rounder
withCurrency(Currency currency)
Associates a currency with this rounding strategy.-
Methods inherited from class com.ibm.icu.number.Rounder
apply, clone, currency, fixedDigits, fixedFraction, increment, integer, maxDigits, maxFraction, minDigits, minFraction, minMaxDigits, minMaxFraction, unlimited, withMode, withMode
-
-
-
-
Method Detail
-
withCurrency
public Rounder withCurrency(Currency currency)
Associates a currency with this rounding strategy.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.
- Parameters:
currency
- The currency to associate with this rounding strategy.- Returns:
- A Rounder for chaining or passing to the NumberFormatter rounding() setter.
- See Also:
NumberFormatter
-
-