Keep in mind that there aren't multiple ways of storing real numbers (other than float and double): all of them conform to the IEEE 754 standard. There is no notion of some real numbers being stored in scientific notation and some in another format: all real numbers are stored the same way in
Java. The difference is when the number gets printed out. And using "DecimalFormat" you have complete control over that.
Compile and run this code as an example:
When I run on Win2K using JDK1.4.2 the results are:
D1: 5.4E-6
D2: 5.4E-6
So both "d1" and "d2" refer to the same value, there are just different ways of representing it in "human-readable" form. You don't like scientific notation? Then get in the habit of using "DecimalFormat" to control the display.
I'm unaware of a way of registering a defaul decimal format when you start the JDK, but if there is you could control it at that level.
[ November 12, 2003: Message edited by: Wayne L Johnson ]