Here you can find the source of formatAmount(BigDecimal amount)
public static String formatAmount(BigDecimal amount)
//package com.java2s; import java.math.BigDecimal; import java.text.NumberFormat; public class Main { public static String formatAmount(double amount) { NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(0);//from w w w . j a v a 2s .co m nf.setGroupingUsed(false); return nf.format(amount); } public static String formatAmount(BigDecimal amount) { NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(0); nf.setGroupingUsed(false); return nf.format(amount); } }