Might want to take a look at the DecimalFormat class.

Or the DateFormat class for that matter!