Here you can find the source of format(BigDecimal decimal)
public static String format(BigDecimal decimal)
//package com.java2s; /*/*from ww w . jav a 2s . com*/ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.math.BigDecimal; import java.text.DecimalFormat; public class Main { public static String format(BigDecimal decimal) { DecimalFormat df = new DecimalFormat("#,###.##"); return df.format(decimal); } }