Java examples for java.lang:double Format
double format Scientific
//package com.java2s; import java.text.DecimalFormat; public class Main { public static String formatScientific(double datum) { DecimalFormat df = new DecimalFormat("0.###E0"); return df.format(datum); }//w w w . j a v a 2 s. c o m public static String format(double datum, String pattern) { DecimalFormat df = new DecimalFormat(pattern); return df.format(datum); } }