Here you can find the source of divide(BigDecimal a, BigDecimal b)
public static BigDecimal divide(BigDecimal a, BigDecimal b)
//package com.java2s; import java.math.BigDecimal; import java.math.RoundingMode; public class Main { private static int scale = 5; public static BigDecimal divide(BigDecimal a, BigDecimal b) { return a.divide(b, scale, RoundingMode.HALF_UP); }//from w w w. j a va2 s .co m }