Here you can find the source of round(BigDecimal decimal)
public static BigDecimal round(BigDecimal decimal)
//package com.java2s; //License from project: LGPL import java.math.BigDecimal; public class Main { public static BigDecimal round(BigDecimal decimal) { return new BigDecimal(Math.round(decimal.doubleValue())); }/*from w w w .ja v a2 s . c o m*/ public static BigDecimal round(BigDecimal v, int scale) { if (scale < 0) { throw new IllegalArgumentException("The scale must be a positive integer or zero"); } BigDecimal b = new BigDecimal(Double.toString(v.doubleValue())); BigDecimal one = new BigDecimal("1"); return b.divide(one, scale, BigDecimal.ROUND_HALF_UP); } }