Here you can find the source of formatAmount(BigDecimal amount)
public static String formatAmount(BigDecimal amount)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.text.DecimalFormat; public class Main { public static String formatAmount(Double amount) { return String.format("%.2f", amount); }//from ww w.ja va 2 s .c o m public static String formatAmount(BigDecimal amount) { return new DecimalFormat("#0.00").format(amount); } }