Here you can find the source of decimalFormat(double number)
public static String decimalFormat(double number)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { private static DecimalFormat decimalFormat = new DecimalFormat("0.##"); public static String decimalFormat(double number) { return decimalFormat.format(number); }/* w ww. ja va 2s.c o m*/ }