Q:

How To Format A Decimal Number With Exponential factor?

I have this number

1.2345679E6

How can I format it to 
1.23E6 using DecimalFormat?
 DecimalFormat df = new DecimalFormat("#.##");

A:

You can use the "E" DecimalFormat formatting specifier to specify scientific notation, with a "0" on the end.
DecimalFormat df = new DecimalFormat("#.##E0");
System.out.println(df.format(1.2345679E6));

This outputs:
1.23E6

