Here you can find the source of decimalFormat(String pattern, double value)
public static String decimalFormat(String pattern, double value)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static String decimalFormat(String pattern, double value) { return new DecimalFormat(pattern).format(value); }/* w ww .ja va 2 s . c om*/ public static String decimalFormat(String pattern, long value) { return new DecimalFormat(pattern).format(value); } }