Here you can find the source of formatCurrency(BigDecimal amount)
public static String formatCurrency(BigDecimal amount)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.text.DecimalFormat; public class Main { public static String formatCurrency(BigDecimal amount) { if (amount.compareTo(BigDecimal.ZERO) <= 0) { return "0"; }/*from w w w. j a va2s. co m*/ DecimalFormat df = new DecimalFormat("#,###.00"); return df.format(amount); } }