Here you can find the source of divide(Object dividend, Object divisor)
public static BigDecimal divide(Object dividend, Object divisor)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static final int SCALE = 2; public static final int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP; public static BigDecimal divide(Object dividend, Object divisor) { return new BigDecimal(dividend.toString()).divide(new BigDecimal(divisor.toString()), SCALE, ROUNDING_MODE); //dividend.divide(divisor, SCALE, ROUNDING_MODE); }//from w ww . j av a2 s . c o m }