Here you can find the source of bigDecimalToString(BigDecimal dec)
public static String bigDecimalToString(BigDecimal dec)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static String bigDecimalToString(BigDecimal dec) { if (dec == null) { return "0"; }/*from www . ja va2 s . c om*/ if (dec.toString().length() < 10) { return dec.toString(); } return dec.toString().substring(0, 10) + dec.toString().substring(dec.toString().length() - 6); } }