Package com.ibm.icu.number
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:
-
Field Summary
Fields inherited from class com.ibm.icu.number.NumberFormatterSettings
KEY_DECIMAL, KEY_GROUPING, KEY_INTEGER, KEY_LOCALE, KEY_MACROS, KEY_MAX, KEY_NOTATION, KEY_PADDER, KEY_PER_UNIT, KEY_PRECISION, KEY_ROUNDING_MODE, KEY_SCALE, KEY_SIGN, KEY_SYMBOLS, KEY_THRESHOLD, KEY_UNIT, KEY_UNIT_DISPLAY_CASE, KEY_UNIT_WIDTH, KEY_USAGE
-
Constructor Summary
ConstructorsConstructorDescriptionBase constructor; called during startup only.UnlocalizedNumberFormatter
(NumberFormatterSettings<?> parent, int key, Object value) -
Method Summary
Modifier and TypeMethodDescription(package private) UnlocalizedNumberFormatter
ULocale version of thelocale(Locale)
setter above.Associate the given locale with the number formatter.Methods inherited from class com.ibm.icu.number.NumberFormatterSettings
decimal, displayOptions, equals, grouping, hashCode, integerWidth, macros, notation, padding, perUnit, precision, resolve, roundingMode, scale, sign, symbols, symbols, threshold, toSkeleton, unit, unitDisplayCase, unitWidth, usage
-
Constructor Details
-
UnlocalizedNumberFormatter
UnlocalizedNumberFormatter()Base constructor; called during startup only. Sets the threshold to the default value of 3. -
UnlocalizedNumberFormatter
UnlocalizedNumberFormatter(NumberFormatterSettings<?> parent, int key, Object value)
-
-
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
-
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:
-
create
- Specified by:
create
in classNumberFormatterSettings<UnlocalizedNumberFormatter>
-