Here you can find the source of divide(BigDecimal num1, BigDecimal num2, int scale, int mode)
public static BigDecimal divide(BigDecimal num1, BigDecimal num2, int scale, int mode)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static BigDecimal divide(BigDecimal num1, BigDecimal num2, int scale, int mode) { if (null == num1) { num1 = BigDecimal.ZERO; }/* ww w .j a v a2 s.co m*/ if (num2 == null) { return null; } return num1.divide(num2, scale, mode); } public static BigDecimal divide(BigDecimal num1, BigDecimal num2) { return divide(num1, num2, 0, BigDecimal.ROUND_HALF_UP); } }