Uses of Class
java.text.NumberFormat
Package
Description
Provides classes and interfaces for handling text, dates, numbers,
and messages in a manner independent of natural languages.
Service provider classes for the classes in the java.text package.
Provides classes and interfaces that deal with editable and noneditable text
components.
-
Uses of NumberFormat in java.text
Modifier and TypeClassDescriptionclass
AChoiceFormat
allows you to attach a format to a range of numbers.class
CompactNumberFormat
is a concrete subclass ofNumberFormat
that formats a decimal number in its compact form.class
DecimalFormat
is a concrete subclass ofNumberFormat
that formats decimal numbers.Modifier and TypeFieldDescriptionprotected NumberFormat
DateFormat.numberFormat
The number formatter thatDateFormat
uses to format numbers in dates and times.Modifier and TypeMethodDescriptionstatic NumberFormat
NumberFormat.getCompactNumberInstance()
static NumberFormat
NumberFormat.getCompactNumberInstance(Locale locale, NumberFormat.Style formatStyle)
Returns a compact number format for the specifiedlocale
andformatStyle
.static NumberFormat
NumberFormat.getCurrencyInstance()
Returns a currency format for the current defaultFORMAT
locale.static NumberFormat
NumberFormat.getCurrencyInstance(Locale inLocale)
Returns a currency format for the specified locale.static NumberFormat
NumberFormat.getInstance()
Returns a general-purpose number format for the current defaultFORMAT
locale.static NumberFormat
NumberFormat.getInstance(Locale inLocale)
Returns a general-purpose number format for the specified locale.static NumberFormat
NumberFormat.getIntegerInstance()
Returns an integer number format for the current defaultFORMAT
locale.static NumberFormat
NumberFormat.getIntegerInstance(Locale inLocale)
Returns an integer number format for the specified locale.DateFormat.getNumberFormat()
Gets the number formatter which this date/time formatter uses to format and parse a time.static NumberFormat
NumberFormat.getNumberInstance()
Returns a general-purpose number format for the current defaultFORMAT
locale.static NumberFormat
NumberFormat.getNumberInstance(Locale inLocale)
Returns a general-purpose number format for the specified locale.static NumberFormat
NumberFormat.getPercentInstance()
Returns a percentage format for the current defaultFORMAT
locale.static NumberFormat
NumberFormat.getPercentInstance(Locale inLocale)
Returns a percentage format for the specified locale.Modifier and TypeMethodDescriptionvoid
DateFormat.setNumberFormat(NumberFormat newNumberFormat)
Allows you to set the number formatter. -
Uses of NumberFormat in java.text.spi
Modifier and TypeMethodDescriptionNumberFormatProvider.getCompactNumberInstance(Locale locale, NumberFormat.Style formatStyle)
Returns a newNumberFormat
instance which formats a number in its compact form for the specifiedlocale
andformatStyle
.abstract NumberFormat
NumberFormatProvider.getCurrencyInstance(Locale locale)
Returns a newNumberFormat
instance which formats monetary values for the specified locale.abstract NumberFormat
NumberFormatProvider.getIntegerInstance(Locale locale)
Returns a newNumberFormat
instance which formats integer values for the specified locale.abstract NumberFormat
NumberFormatProvider.getNumberInstance(Locale locale)
Returns a new general-purposeNumberFormat
instance for the specified locale.abstract NumberFormat
NumberFormatProvider.getPercentInstance(Locale locale)
Returns a newNumberFormat
instance which formats percentage values for the specified locale. -
Uses of NumberFormat in javax.swing.text
ModifierConstructorDescriptionNumberFormatter(NumberFormat format)
Creates a NumberFormatter with the specified Format instance.