public class LocalizedNumberFormatter extends NumberFormatterSettings<LocalizedNumberFormatter>
NumberFormatter
,
NumberFormatter
Modifier and Type | Method and Description |
---|---|
FormattedNumber |
format(com.ibm.icu.impl.number.DecimalQuantity fq)
Deprecated.
ICU 60 This API is ICU internal only.
|
FormattedNumber |
format(double input)
Format the given float or double to a string using the settings specified in the NumberFormatter
fluent setting chain.
|
FormattedNumber |
format(long input)
Format the given byte, short, int, or long to a string using the settings specified in the
NumberFormatter fluent setting chain.
|
FormattedNumber |
format(Measure input)
Format the given
Measure or CurrencyAmount to a string using the settings
specified in the NumberFormatter fluent setting chain. |
FormattedNumber |
format(java.lang.Number input)
Format the given
BigInteger , BigDecimal , or other Number to a string using
the settings specified in the NumberFormatter fluent setting chain. |
java.lang.String |
getAffixImpl(boolean isPrefix,
boolean isNegative)
Deprecated.
This API is ICU internal only. Use
FormattedNumber.populateFieldPosition(java.text.FieldPosition) or
FormattedNumber.getFieldIterator() for similar functionality. |
java.text.Format |
toFormat()
Creates a representation of this LocalizedNumberFormat as a
Format , enabling the
use of this number formatter with APIs that need an object of that type, such as MessageFormat. |
public FormattedNumber format(long input)
input
- The number to format.NumberFormatter
public FormattedNumber format(double input)
input
- The number to format.NumberFormatter
public FormattedNumber format(java.lang.Number input)
BigInteger
, BigDecimal
, or other Number
to a string using
the settings specified in the NumberFormatter fluent setting chain.input
- The number to format.NumberFormatter
public FormattedNumber format(Measure input)
Measure
or CurrencyAmount
to a string using the settings
specified in the NumberFormatter fluent setting chain.
The unit specified here overrides any unit that may have been specified in the setter chain. This method is intended for cases when each input to the number formatter has a different unit.
input
- The number to format.NumberFormatter
public java.text.Format toFormat()
Format
, enabling the
use of this number formatter with APIs that need an object of that type, such as MessageFormat.
This API is not intended to be used other than for enabling API compatibility. The format(long)
methods should normally be used when formatting numbers, not the Format object returned by this
method.
NumberFormatter
@Deprecated public FormattedNumber format(com.ibm.icu.impl.number.DecimalQuantity fq)
This function is very hot, being called in every call to the number formatting pipeline.
fq
- The quantity to be formatted.@Deprecated public java.lang.String getAffixImpl(boolean isPrefix, boolean isNegative)
FormattedNumber.populateFieldPosition(java.text.FieldPosition)
or
FormattedNumber.getFieldIterator()
for similar functionality.Copyright ? 2016 Unicode, Inc. and others.