Here you can find the source of format(final double number)
public static String format(final double number)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static final DecimalFormat DEFAULT_FORMAT = new DecimalFormat("#.####"); public static String format(final float number) { return DEFAULT_FORMAT.format(number); }//from w ww. jav a 2 s . c o m public static String format(final double number) { return DEFAULT_FORMAT.format(number); } }