Java Number Add addDoubles(Double value, Double addValue)

Here you can find the source of addDoubles(Double value, Double addValue)

Description

add Doubles

License

Apache License

Declaration

public static Double addDoubles(Double value, Double addValue) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;

public class Main {

    public static Double addDoubles(Double value, Double addValue) {
        BigDecimal sum = BigDecimal.ZERO; // new BigDecimal(0)
        if (value != null) {
            sum = BigDecimal.valueOf(value);
        }// www . j  ava2 s .  c  o  m
        if (addValue != null) {
            sum = sum.add(BigDecimal.valueOf(addValue));
        }
        return sum.doubleValue();
    }
}

Related

  1. add(String number1, String number2)
  2. add(T a, T b)
  3. add1(Double v1, Double v2)
  4. add4Money(Double value1, Double value2)
  5. addAmounts(final double num1, final double num2)
  6. addDoubles(String str1, String str2, int rounding)
  7. DoubleToInt(double d, double multiply, double add)
  8. readDoubleAsString(String doubleAsString)