Here you can find the source of formatDollar(Object obj)
public static String formatDollar(Object obj)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; import java.math.BigDecimal; public class Main { public static String formatDollar(Object obj) { // null gets converted to empty string if (obj == null) { return ""; }/* w w w.j a v a 2 s .co m*/ BigDecimal bd = (BigDecimal) obj; try { DecimalFormat intFormat = new DecimalFormat("$###,###,###,##0.00"); return intFormat.format(bd); } catch (Exception e) { return "bad Dollar Amount in FormatUtils:" + obj.toString() + " Error:" + e.getMessage(); } } }