Here you can find the source of getFormatAmount(Double d)
public static String getFormatAmount(Double d)
//package com.java2s; import java.text.DecimalFormat; public class Main { public static String getFormatAmount(Double d) { if (d == null) { return "0.00"; }/*from w ww . j av a 2 s . com*/ DecimalFormat df = new DecimalFormat("0.00"); return df.format(d); } public static String getFormatAmount(int i) { DecimalFormat df = new DecimalFormat("0.00"); return df.format(i); } }