All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ChoiceFormat, CompactNumberFormat, DecimalFormat

  • Nested Class Summary

    Nested Classes

    static class 

    Defines constants that are used as attribute keys in the AttributedCharacterIterator returned from NumberFormat.formatToCharacterIterator and as field identifiers in FieldPosition.

    static enum 

  • Field Summary

    Fields

    static final int

    Field constant used to construct a FieldPosition object.

    static final int

    Field constant used to construct a FieldPosition object.

  • Constructor Summary

    Constructors

  • Method Summary

    clone()

    boolean

    Compares the specified object with this NumberFormat for equality.

    format(double number)

    Specialization of format.

    Specialization of format.

    format(long number)

    Specialization of format.

    Specialization of format.

    Formats a number and appends the resulting text to the given string buffer.

    Returns an array of all locales for which the get*Instance methods of this class can return localized instances.

    Returns a compact number format for the default FORMAT locale with "SHORT" format style.

    Gets the currency used by this number format when formatting currency values.

    Returns a currency format for the current default FORMAT locale.

    Returns a currency format for the specified locale.

    Returns a general-purpose number format for the current default FORMAT locale.

    Returns a general-purpose number format for the specified locale.

    Returns an integer number format for the current default FORMAT locale.

    Returns an integer number format for the specified locale.

    int

    Returns the maximum number of digits allowed in the fraction portion of a number during formatting.

    int

    Returns the maximum number of digits allowed in the integer portion of a number during formatting.

    int

    Returns the minimum number of digits allowed in the fraction portion of a number during formatting.

    int

    Returns the minimum number of digits allowed in the integer portion of a number during formatting.

    Returns a general-purpose number format for the current default FORMAT locale.

    Returns a general-purpose number format for the specified locale.

    Returns a percentage format for the current default FORMAT locale.

    Returns a percentage format for the specified locale.

    int

    hashCode()

    Returns the hash code for this NumberFormat.

    boolean

    Returns true if grouping is used in this format.

    boolean

    Returns true if this format will parse numbers as integers only.

    boolean

    isStrict()

    Returns true if this format will parse numbers strictly; false otherwise.

    Parses text from the beginning of the given string to produce a Number.

    Parses text from the beginning of the given string to produce a Number.

    Parses text from the given string to produce an object.

    void

    Sets the currency used by this number format when formatting currency values.

    void

    setGroupingUsed(boolean newValue)

    Set whether or not grouping will be used in this format.

    void

    setMaximumFractionDigits(int newValue)

    Sets the maximum number of digits allowed in the fraction portion of a number during formatting.

    void

    setMaximumIntegerDigits(int newValue)

    Sets the maximum number of digits allowed in the integer portion of a number during formatting.

    void

    setMinimumFractionDigits(int newValue)

    Sets the minimum number of digits allowed in the fraction portion of a number during formatting.

    void

    setMinimumIntegerDigits(int newValue)

    Sets the minimum number of digits allowed in the integer portion of a number during formatting.

    void

    setParseIntegerOnly(boolean value)

    Sets whether or not numbers should be parsed as integers only.

    void

    void

    setStrict(boolean strict)

    Change the leniency value for parsing.

    Methods declared in class Format

    format, formatToCharacterIterator, parseObject

    Formats an object to produce a string.

    Formats an Object producing an AttributedCharacterIterator.

    Parses text from the beginning of the given string to produce an object.

    Methods declared in class Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    Returns a string representation of the object.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

  • Field Details

    • INTEGER_FIELD

    • FRACTION_FIELD

  • Constructor Details

    • NumberFormat

  • Method Details

    • format

    • parseObject

    • format

    • format

    • format

    • format

    • parse

    • parse

    • isParseIntegerOnly

    • setParseIntegerOnly

    • isStrict

    • setStrict

    • getInstance

    • getInstance

    • getNumberInstance

    • getNumberInstance

    • getIntegerInstance

    • getIntegerInstance

    • getCurrencyInstance

    • getCurrencyInstance

    • getPercentInstance

    • getPercentInstance

    • getCompactNumberInstance

    • getCompactNumberInstance

    • getAvailableLocales

    • hashCode

    • equals

    • clone

    • isGroupingUsed

    • setGroupingUsed

    • getMaximumIntegerDigits

    • setMaximumIntegerDigits

    • getMinimumIntegerDigits

    • setMinimumIntegerDigits

    • getMaximumFractionDigits

    • setMaximumFractionDigits

    • getMinimumFractionDigits

    • setMinimumFractionDigits

    • getCurrency

    • setCurrency

    • getRoundingMode

    • setRoundingMode