All Implemented Interfaces:
Serializable, Cloneable

  • Nested Class Summary

    Nested classes/interfaces declared in class NumberFormat

    NumberFormat.Field, NumberFormat.Style

    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 declared in class NumberFormat

    FRACTION_FIELD, INTEGER_FIELD

    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

    Creates a DecimalFormat using the default pattern and symbols for the default FORMAT locale.

    Creates a DecimalFormat using the given pattern and the symbols for the default FORMAT locale.

    Creates a DecimalFormat using the given pattern and symbols.

  • Method Summary

    void

    Apply the given pattern to this Format object.

    void

    Apply the given pattern to this Format object.

    clone()

    Standard override; no change in semantics.

    boolean

    Compares the specified object with this DecimalFormat for equality.

    Formats a double to produce a string.

    Format a long to produce a string.

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

    Formats an Object producing an AttributedCharacterIterator.

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

    Returns a copy of the decimal format symbols, which is generally not changed by the programmer or user.

    int

    Return the grouping size.

    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.

    int

    Gets the multiplier for use in percent, per mille, and similar formats.

    int

    hashCode()

    Returns the hash code for this DecimalFormat.

    boolean

    Allows you to get the behavior of the decimal separator with integers.

    boolean

    Returns whether the parse(java.lang.String, java.text.ParsePosition) method returns BigDecimal.

    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.

    void

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

    void

    Sets the decimal format symbols, which is generally not changed by the programmer or user.

    void

    setDecimalSeparatorAlwaysShown(boolean newValue)

    Allows you to set the behavior of the decimal separator with integers.

    void

    setGroupingSize(int newValue)

    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

    setMultiplier(int newValue)

    Sets the multiplier for use in percent, per mille, and similar formats.

    void

    void

    void

    setParseBigDecimal(boolean newValue)

    Sets whether the parse(java.lang.String, java.text.ParsePosition) method returns BigDecimal.

    void

    void

    void

    void

    setStrict(boolean strict)

    Change the leniency value for parsing.

    Synthesizes a localized pattern string that represents the current state of this Format object.

    toPattern()

    Synthesizes a pattern string that represents the current state of this Format object.

    toString()

    Returns a string identifying this DecimalFormat, for debugging.

    Methods declared in class NumberFormat

    format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setGroupingUsed, setParseIntegerOnly

    Specialization of format.

    Specialization of format.

    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.

    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.

    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.

    boolean

    Returns true if grouping is used in this format.

    boolean

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

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

    Parses text from the given string to produce an object.

    void

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

    void

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

    Methods declared in class Format

    format, parseObject

    Formats an object to produce a string.

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

    Methods declared in class Object

    finalize, getClass, notify, notifyAll, 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.

    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.

  • Constructor Details

    • DecimalFormat

    • DecimalFormat

    • DecimalFormat

  • Method Details

    • format

    • format

    • format

    • formatToCharacterIterator

    • parse

    • getDecimalFormatSymbols

    • setDecimalFormatSymbols

    • getPositivePrefix

    • setPositivePrefix

    • getNegativePrefix

    • setNegativePrefix

    • getPositiveSuffix

    • setPositiveSuffix

    • getNegativeSuffix

    • setNegativeSuffix

    • getMultiplier

    • setMultiplier

    • getGroupingSize

    • setGroupingSize

    • isDecimalSeparatorAlwaysShown

    • setDecimalSeparatorAlwaysShown

    • isStrict

    • setStrict

    • isParseBigDecimal

    • setParseBigDecimal

    • clone

    • equals

    • hashCode

    • toString

    • toPattern

    • toLocalizedPattern

    • applyPattern

    • applyLocalizedPattern

    • setMaximumIntegerDigits

    • setMinimumIntegerDigits

    • setMaximumFractionDigits

    • setMinimumFractionDigits

    • getMaximumIntegerDigits

    • getMinimumIntegerDigits

    • getMaximumFractionDigits

    • getMinimumFractionDigits

    • getCurrency

    • setCurrency

    • getRoundingMode

    • setRoundingMode