Java BigDecimal Divide divide(BigDecimal v1, BigDecimal v2)

Here you can find the source of divide(BigDecimal v1, BigDecimal v2)

Description

divide

License

Open Source License

Declaration

public static BigDecimal divide(BigDecimal v1, BigDecimal v2) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {

    public static BigDecimal divide(String v1, String v2) {

        return divide(new BigDecimal(v1), new BigDecimal(v2));
    }// w w  w . ja v  a 2  s.  c  om

    public static BigDecimal divide(double v1, double v2) {

        return divide(new BigDecimal(v1), new BigDecimal(v2));
    }

    public static BigDecimal divide(BigDecimal v1, BigDecimal v2) {

        return divide(v1, v2, 2, BigDecimal.ROUND_HALF_UP);
    }

    public static BigDecimal divide(BigDecimal v1, BigDecimal v2, int scale, int roundingMode) {

        return v1.divide(v2, scale, roundingMode);
    }
}

Related

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