Here you can find the source of format2String(BigDecimal bd)
public static String format2String(BigDecimal bd)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static String format2String(BigDecimal bd) { if (bd != null) { bd = bd.setScale(2, RoundingMode.HALF_UP); return bd.toString(); } else {/*from w w w. jav a 2 s . co m*/ return null; } } }