public class LocalizedNumberFormatter extends NumberFormatterSettings<LocalizedNumberFormatter>
NumberFormatter
,
NumberFormatter
Modifier and Type | Method and Description |
---|---|
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. |
void |
formatImpl(com.ibm.icu.impl.number.DecimalQuantity fq,
com.ibm.icu.impl.number.NumberStringBuilder string)
Deprecated.
ICU 60 This API is ICU internal only.
|
java.lang.String |
getAffixImpl(boolean isPrefix,
boolean isNegative)
Deprecated.
This API is ICU internal only. Use
FormattedNumber.nextPosition(com.ibm.icu.text.ConstrainedFieldPosition)
for related 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. |
decimal, equals, grouping, hashCode, integerWidth, macros, notation, padding, perUnit, precision, roundingMode, scale, sign, symbols, symbols, threshold, toSkeleton, unit, unitWidth
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 void formatImpl(com.ibm.icu.impl.number.DecimalQuantity fq, com.ibm.icu.impl.number.NumberStringBuilder string)
This function is very hot, being called in every call to the number formatting pipeline.
fq
- The quantity to be formatted.string
- The string builder into which to insert the result.@Deprecated public java.lang.String getAffixImpl(boolean isPrefix, boolean isNegative)
FormattedNumber.nextPosition(com.ibm.icu.text.ConstrainedFieldPosition)
for related functionality.Copyright ? 2016 Unicode, Inc. and others.