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(Number input)
Format the given
BigInteger , BigDecimal , or other Number to a string using
the settings specified in the NumberFormatter fluent setting chain. |
com.ibm.icu.impl.number.MicroProps |
formatImpl(com.ibm.icu.impl.number.DecimalQuantity fq,
com.ibm.icu.impl.FormattedStringBuilder string)
Deprecated.
ICU 60 This API is ICU internal only.
|
com.ibm.icu.impl.number.MicroProps |
formatImpl(com.ibm.icu.impl.number.DecimalQuantity fq,
MeasureUnit unit,
com.ibm.icu.impl.FormattedStringBuilder string)
Deprecated.
ICU 67 This API is ICU internal only.
|
String |
getAffixImpl(boolean isPrefix,
boolean isNegative)
Deprecated.
This API is ICU internal only. Use
FormattedNumber.nextPosition(com.ibm.icu.text.ConstrainedFieldPosition)
for related functionality. |
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. |
UnlocalizedNumberFormatter |
withoutLocale()
Disassociate the locale from this formatter.
|
decimal, displayOptions, equals, grouping, hashCode, integerWidth, macros, notation, padding, perUnit, precision, roundingMode, scale, sign, symbols, symbols, threshold, toSkeleton, unit, unitDisplayCase, unitWidth, usage
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(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 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
public UnlocalizedNumberFormatter withoutLocale()
@Deprecated public com.ibm.icu.impl.number.MicroProps formatImpl(com.ibm.icu.impl.number.DecimalQuantity fq, com.ibm.icu.impl.FormattedStringBuilder 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 com.ibm.icu.impl.number.MicroProps formatImpl(com.ibm.icu.impl.number.DecimalQuantity fq, MeasureUnit unit, com.ibm.icu.impl.FormattedStringBuilder string)
@Deprecated public String getAffixImpl(boolean isPrefix, boolean isNegative)
FormattedNumber.nextPosition(com.ibm.icu.text.ConstrainedFieldPosition)
for related functionality.Copyright © 2016 Unicode, Inc. and others.