When following code is executed:
DecimalFormat eNotation1 = new DecimalFormat("#0.###E0");
System.out.println(eNotation1.format(123.456789));
My expected output is;
1.235E2
instead,
1.2346E2
was printed.
Why was the output 1.2346E2
?
I know I could have used a method like setMaximumFractionDigits()
if all I wanted was to set the maximum number of digits after the decimal point, but I just really want to understand why the output was 1.2346E2