Here you can find the source of toDecimalFormat(BigDecimal value)
public static String toDecimalFormat(BigDecimal value)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.text.DecimalFormat; public class Main { public static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("$###,##0.00"); public static String toDecimalFormat(BigDecimal value) { return value != null ? DECIMAL_FORMAT.format(value) : "$0.00"; }// ww w .j a v a 2 s . com }