Here you can find the source of format(double value, String formatString)
public static String format(double value, String formatString)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { public static String format(double value, String formatString) { return new DecimalFormat(formatString).format(value); }/* ww w .j a va 2 s. co m*/ }