
DecimalFormat
Package: java.text
Description: provides methods for formatting numbers for output
Constructor
DecimalFormat( String pattern )
instantiates a DecimalFormat object with the output pattern spec-
ified in the argument
A Useful Method of the DecimalFormat Class
Return value Method name and argument list
String format( double number )
returns a String representation of number formatted according to
the DecimalFormat pattern used to instantiate the object.This
method is inherited from the NumberFormat class.
Commonly Used Pattern Symbols for a DecimalFormat Object
Symbol Meaning
0 Required digit.If the value for the digit in this position is 0,inser ...