Here you can find the source of doubleToString(Double d, String format)
public static final String doubleToString(Double d, String format)
//package com.java2s; import java.text.DecimalFormat; public class Main { public static final String doubleToString(Double d, String format) { DecimalFormat df = new DecimalFormat(format); return df.format(d); }/*from w ww .j a v a 2 s . c om*/ }