Java BigDecimal Divide divide(final BigDecimal amount, final BigDecimal divideBy, final int scale)

Here you can find the source of divide(final BigDecimal amount, final BigDecimal divideBy, final int scale)

Description

divide

License

Apache License

Declaration

public static BigDecimal divide(final BigDecimal amount, final BigDecimal divideBy, final int scale) 

Method Source Code


//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
}

Related

  1. divide(BigDecimal number1, BigDecimal number2, int decimalPlaces)
  2. divide(BigDecimal numerator, BigDecimal denominator)
  3. divide(BigDecimal one, BigDecimal another)
  4. divide(BigDecimal op1, int op2, int precision)
  5. divide(BigDecimal v1, BigDecimal v2)
  6. divide(long res, BigDecimal value)
  7. divide(Vector v, BigDecimal magnitude)
  8. divideBigDecimalsInMap(Map baseMap, BigDecimal divisor)
  9. divideBy(BigDecimal dividend, BigDecimal divisor)