Formatting Numbers
Home ] Up ] MessageFormat ] Explicit Formats ] Summary of Patterns ] [ Formatting Numbers ]

 

Using NumberFormat
Using DecimalFormat
DecimalFormat Example
Using MessageFormat

 

When you use MessageFormat and provide a number as one of the arguments, you must specify an object, not a primitive type. The Number class hierarchy is as follows:

  • Number
    • Byte
    • Double
    • Float
    • Integer
    • Long
    • Short
    • BigInteger
    • BigDecimal

The family of classes used to format numbers is:

  • Format
    • NumberFormat
      • DecimalFormat
      • ChoiceFormat
 
The page was last updated February 19, 2008