Answer:
No. The bits invalue provide data for format()
when it creates a string of characters, but the bits in value are not changed.
(The rounding only affects the characters, not the value.)
Floating Point Formatting Applet
Here is an applet that formats a double
using DecimalFormat.format()
|
Embedded Java applet removed: modern browsers do not support Java applets. The surrounding source code is retained for historical study.
|
If you enter characters that can't be converted into a double,
an error message will be written.
If you want to see lots of zeros, enter something like 1E21.
Enter 1E999 and see what happens.
Experiment a bit with rounding.
Enter 1.999999999 and see what happens.
QUESTION 6:
What happens when 1.999999999 is displayed?