import java.text.DecimalFormat; public class Test { public static void main(String []args){ double a=2.828718623884379E-4; double b=0.00001714; double c=8.569E-7; System.out.println(getFormat(a)); System.out.println(getFormat(b)); System.out.println(getFormat(c)); } public static String getFormat(double input){ DecimalFormat df = new DecimalFormat( "0.00E0"); String temp1 = df.format(input); return temp1.toString(); } }