Format double value in scientific notation

    System.out.println(String.format("%6.3e",223.45654543434));

results in

    2.235e+02

which is the closest I get.

more info : http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html#syntax

Leave a Comment