abstract class NumberFormat extends Format

Purpose

bullet Provides methods for formatting and parsing numbers and serves as an abstract superclass for number formatting.

Field summary

bullet static int FRACTION_FIELD
bullet Indicates the fraction field of a FieldPosition.
bullet static int INTEGER_FIELD
bullet Indicates the integer field of a FieldPosition.

Class Method Summary

bullet static Locale[] getAvailableLocales()
bullet Returns the array of possible NumberFormat locales.
bullet static NumberFormat getCurrencyInstance()
bullet Returns a default currency NumberFormat for the default locale.
bullet static NumberFormat getCurrencyInstance(Locale l)
bullet Returns a default currency NumberFormat for the locale l.
bullet static NumberFormat getInstance()
bullet Returns a default NumberFormat for the default locale.
bullet static NumberFormat getInstance(Locale l)
bullet Returns a default NumberFormat for locale l.
bullet static NumberFormat getIntegerInstance()
bullet Returns a default integer NumberFormat for the default locale.
bullet static NumberFormat getIntegerInstance(Locale l)
bullet Returns a default integer NumberFormat for locale l.
bullet static NumberFormatgetNumberInstance()
bullet Returns a default number NumberFormat for the default locale.
bullet static NumberFormat getNumberInstance(Locale l)
bullet Returns a default number NumberFormat for locale l.
bullet static NumberFormat getPercentInstance()
bullet Returns a default percentage NumberFormat for the default locale.
bullet static NumberFormat getPercentInstance(Locale l)
bullet Returns a default percentage NumberFormat for locale l.

Constructor summary

bullet NumberFormat()
bullet Constructs a new NumberFormat number formatter.

Instance Method Summary

bullet Object clone()
bullet Returns a clone of this NumberFormat.
bullet boolean equals(Object v)
bullet Returns true if and only if v is an instance of NumberFormat representing the same format value that this object represents.
bullet String format(double n)
bullet Formats number n into a string using this NumberFormat.
bullet abstract StringBuffer format(double n, StringBuffer s, FieldPosition f)
bullet Returns s after formatting number n into string s using this NumberFormat. If f indicates a field, then its indices are updated to reflect the position of the field within s.
bullet String format(long n)
bullet Formats number n into a string using this NumberFormat.
bullet abstract StringBuffer format(long n, StringBuffer s, FieldPosition f)
bullet Returns s after formatting number n into string s using this NumberFormat. If f indicates a field, then its indices are updated to reflect the position of the field within s.
bullet StringBuffer format(Object n, StringBuffer s, FieldPosition f)
bullet Returns s after formatting the number represented by n into string s using this NumberFormat. If f indicates a field, then its indices are updated to reflect the position of the field within s.
bullet Currency getCurrency()
bullet Returns the currency format used by this NumberFormat.
bullet int getMaximumFractionDigits()
bullet Returns the maximum number of digits used in formatting the fractional part of a number by this NumberFormat.
bullet int getMaximumIntegerDigits()
bullet Returns the maximum number of digits used in formatting the integer part of a number by this NumberFormat.
bullet int getMinimumFractionDigits()
bullet Returns the minimum number of digits used in formatting the fractional part of a number by this NumberFormat.
bullet int getMinimumIntegerDigits()
bullet Returns the minimum number of digits used in formatting the integer part of a number by this NumberFormat.
bullet int hashCode()
bullet Returns the hash code of this NumberFormat.
bullet boolean isGroupingUsed()
bullet Returns whether this NumberFormat uses grouping.
bullet boolean isParseIntegerOnly()
bullet Returns whether this NumberFormat only parses numbers as integers.
bullet Number parse(String s)
bullet Parses s to produce a number using this DateFormat.
bullet abstract Number parse(String s, ParsePosition i)
bullet Parses s to produce a Number using this NumberFormat. The parsing starts with the parse position indicated by i. Upon completion of parsing, i reflects the last parsed position. The preferred actual type is Long. If Long is unsuitable, then Double is used.
bullet Object parseObject(String s, ParsePosition i)
bullet Parses s to produce a Number using this NumberFormat. The parsing starts with the parse position indicated by i. Upon completion of parsing, i reflects the last parsed position.
bullet void setCurrency(Currency c)
bullet Sets to c the Currency used by this NumberFormat.
bullet void setGroupingUsed(boolean b)
bullet Sets whether this NumberFormat uses grouping.
bullet void setMaximumFractionDigits(int n)
bullet Sets to n the maximum number of digits used in formatting the fractional part of a number by this NumberFormat.
bullet void setMaximumIntegerDigits(int n)
bullet Sets to n the maximum number of digits used in formatting the integer part of a number by this NumberFormat.
bullet void setMinimumFractionDigits(int n)
bullet Sets to n the minimum number of digits used in formatting the fractional part of a number by this NumberFormat.
bullet void setMinimumIntegerDigits(int n)
bullet Sets to n the minimum number of digits used in formatting the integer part of a number by this NumberFormat.
bullet void setParseIntegerOnly(boolean b)
bullet Sets whether this NumberFormat parses numbers only as integers.