Originally posted by Kim Kantola: That is wierd. I am not sure I understand Jame's reply. Why would 1.0 + .05 = 1.0499999 regardless of formatting?
Because of rounding. The computer thinks in binary, not decimal. The closest binary approximation to 1.05 is not exact so the computer rounds it to the nearest binary equivalent; the result is the 1.49999... number. Warren
I would actually use the DecimalFormat class for formatting simple numbers (non money). Most beginning texts use this class rather than NumberFormat class.