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