Here you can find the source of bigDecimalToString(BigDecimal number)
public static String bigDecimalToString(BigDecimal number)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.Locale; public class Main { public static String bigDecimalToString(BigDecimal number) { DecimalFormatSymbols symbols = new DecimalFormatSymbols(new Locale("pt", "BR")); symbols.setDecimalSeparator(','); symbols.setCurrencySymbol(""); DecimalFormat decimalFormat = (DecimalFormat) NumberFormat.getNumberInstance(new Locale("pt", "BR")); decimalFormat.setDecimalFormatSymbols(symbols); decimalFormat.setGroupingUsed(false); decimalFormat.setParseBigDecimal(true); decimalFormat.setMinimumFractionDigits(2); decimalFormat.setMaximumFractionDigits(10); return decimalFormat.format(number).trim(); }//from ww w. j a v a 2 s.c om }