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;

public class Main {
    public static BigDecimal subtract(BigDecimal a, BigDecimal b) {
        if (a == null)
            a = new BigDecimal("0.00");
        if (b == null)
            b = new BigDecimal("0.00");
        return a.subtract(b).setScale(2);
    }// w  w  w . ja  v  a2 s. co 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)
  9. subtract(BigDecimal left, BigDecimal right)