Class UnlocalizedNumberFormatter
java.lang.Object
com.ibm.icu.number.NumberFormatterSettings<UnlocalizedNumberFormatter>
com.ibm.icu.number.UnlocalizedNumberFormatter
A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be
specified.
Instances of this class are immutable and thread-safe.
- See Also:
- Status:
- Stable ICU 60.
-
Method Summary
Modifier and TypeMethodDescriptionULocale version of thelocale(Locale)setter above.Associate the given locale with the number formatter.Methods inherited from class NumberFormatterSettings
decimal, displayOptions, equals, grouping, hashCode, integerWidth, macros, notation, padding, perUnit, precision, roundingMode, scale, sign, symbols, symbols, threshold, toSkeleton, unit, unitDisplayCase, unitWidth, usageModifier and TypeMethodDescriptionSets the decimal separator display strategy.displayOptions(DisplayOptions displayOptions) Specifies theDisplayOptions.booleangrouping(NumberFormatter.GroupingStrategy strategy) Specifies the grouping strategy to use when formatting numbers.inthashCode()integerWidth(IntegerWidth style) Specifies the minimum and maximum number of digits to render before the decimal mark.macros(com.ibm.icu.impl.number.MacroProps macros) Deprecated.ICU 60 This API is ICU internal only.Specifies the notation style (simple, scientific, or compact) for rendering numbers.padding(com.ibm.icu.impl.number.Padder padder) Deprecated.ICU 60 This API is ICU internal only.perUnit(MeasureUnit perUnit) Sets a unit to be used in the denominator.Specifies the rounding precision to use when formatting numbers.roundingMode(RoundingMode roundingMode) Specifies how to determine the direction to round a number when it has more digits than fit in the desired precision.Sets a scale (multiplier) to be used to scale the number by an arbitrary amount before formatting.sign(NumberFormatter.SignDisplay style) Sets the plus/minus sign display strategy.symbols(DecimalFormatSymbols symbols) Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc.) to use when rendering numbers.Specifies that the given numbering system should be used when fetching symbols.Deprecated.ICU 60 This API is ICU internal only.Creates a skeleton string representation of this number formatter.unit(MeasureUnit unit) Specifies the unit (unit of measure, currency, or percent) to associate with rendered numbers.unitDisplayCase(String unitDisplayCase) Deprecated.This API is for technology preview only.Sets the width of the unit (measure unit or currency).Specifies the usage for which numbers will be formatted ("person-height", "road", "rainfall", etc.)
-
Method Details
-
locale
Associate the given locale with the number formatter. The locale is used for picking the appropriate symbols, formats, and other data for number display.To use the Java default locale, call Locale.getDefault():
NumberFormatter.with(). ... .locale(Locale.getDefault())
- Parameters:
locale- The locale to use when loading data for number formatting.- Returns:
- The fluent chain
- Status:
- Stable ICU 60.
-
locale
ULocale version of thelocale(Locale)setter above.- Parameters:
locale- The locale to use when loading data for number formatting.- Returns:
- The fluent chain
- See Also:
- Status:
- Stable ICU 60.
-