Format double with 0.#####E0 in Java
Description
The following code shows how to format double with 0.#####E0.
Example
//from ww w . j a v a 2s .co m
import java.text.DecimalFormat;
public class Main {
public static void main(String args[]) {
double d = 0.12345;
System.out.println(new DecimalFormat("0.#####E0").format(d));
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »