Here you can find the source of formatAmount(final BigDecimal number)
public static String formatAmount(final BigDecimal number)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { public static String formatAmount(final BigDecimal number) { NumberFormat formatter = new DecimalFormat(".00"); return formatter.format(number); }/* w w w .j a va 2 s .c om*/ }