Here you can find the source of divide(final BigDecimal amount, final BigDecimal divideBy, final int scale)
public static BigDecimal divide(final BigDecimal amount, final BigDecimal divideBy, final int scale)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static BigDecimal divide(final BigDecimal amount, final BigDecimal divideBy, final int scale) { return amount.setScale(scale, RoundingMode.HALF_EVEN).divide(divideBy, RoundingMode.HALF_EVEN); }//from w w w. j a va 2 s.co m }