Java BigDecimal Subtract sub(BigDecimal v1, BigDecimal v2)

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

Description

sub

License

Open Source License

Declaration

public static BigDecimal sub(BigDecimal v1, BigDecimal v2) 

Method Source Code


//package com.java2s;
/*//from   w w  w .  j  a v  a  2s.co  m
* Copyright 2016 Yonyou Corporation Ltd. All Rights Reserved.
*
* This software is published under the terms of the Yonyou Software
* License version 1.0, a copy of which has been included with this
* distribution in the LICENSE.txt file.
*
* @Project Name : cmol.common.function
*
* @File name : NumberUtil.java
*
* @Author : zhangxc
*
* @Date : 2016?3?29?
*
----------------------------------------------------------------------------------
*     Date       Who       Version     Comments
* 1. 2016?3?29?    zhangxc    1.0
*
*
*
*
----------------------------------------------------------------------------------
*/

import java.math.BigDecimal;

public class Main {

    public static BigDecimal sub(BigDecimal v1, BigDecimal v2) {
        v1 = v1 == null ? BigDecimal.ZERO : v1;
        v2 = v2 == null ? BigDecimal.ZERO : v2;
        return v1.subtract(v2);
    }
}

Related

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