Java BigDecimal Subtract subtract(BigDecimal a, BigDecimal b)

Here you can find the source of subtract(BigDecimal a, BigDecimal b)

Description

subtract

License

Open Source License

Declaration

public static BigDecimal subtract(BigDecimal a, BigDecimal b) 

Method Source Code


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

public class Main {
    private static int scale = 5;

    public static BigDecimal subtract(BigDecimal a, BigDecimal b) {
        return a.subtract(b).setScale(scale, RoundingMode.HALF_UP);
    }/*from   w  ww  .j a  v a 2 s  . c  o  m*/
}

Related

  1. sub(BigDecimal b1, BigDecimal b2)
  2. sub(BigDecimal d1, BigDecimal d2)
  3. sub(BigDecimal v1, BigDecimal v2)
  4. sub(BigDecimal v1, BigDecimal v2)
  5. subtract(BigDecimal a, BigDecimal b)
  6. subtract(BigDecimal amount, BigDecimal subtrahend, int scale)
  7. subtract(BigDecimal aValue1, BigDecimal aValue2)
  8. subtract(BigDecimal bigDecimal, BigDecimal bigDecimal2)