import java.text.*; public class BenytDecimalFormat { public static void main(String[] arg) { DecimalFormat fmt1 = new DecimalFormat("###.#####"); DecimalFormat fmt2 = new DecimalFormat("000.00"); DecimalFormat fmt3 = new DecimalFormat("0.###E0"); DecimalFormat fmt4 = new DecimalFormat("0.#E0"); double tal = 1234.5678; System.out.println( fmt1.format(tal) ); System.out.println( fmt2.format(tal) ); System.out.println( fmt3.format(tal) ); System.out.println( fmt4.format(tal) ); } }