I have several double numbers that are output in this format:
Format.String("%1.4e",doubleNumber);
Result 1.123456e+03. How to set the number of exponent ciphers to get this format:
1.123456e+003
I would always have 3 characters after the character e. thank you
UPDATE 1:
I partially allowed:
DecimalFormat formatter = new DecimalFormat("0.000000E000");
System.out.println (formatter.format (doubleNumber));
Now the number always has the format
1.123456e0xx
or
1.123456e-0xx
But this is not all resolved. I would always print a sign:
1.123456e+0xx or 1.123456e-0xx
How can i do this?
http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html
source
share