Java Number Add add(Object addend, Object augend)

Here you can find the source of add(Object addend, Object augend)

Description

add

License

Open Source License

Declaration

public static BigDecimal add(Object addend, Object augend) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    public static final int SCALE = 2;
    public static final int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;

    public static BigDecimal add(Object addend, Object augend) {
        return new BigDecimal(addend.toString()).add(new BigDecimal(augend.toString())).setScale(SCALE,
                ROUNDING_MODE);//from   w  w w  . j ava  2s.c o m
    }
}

Related

  1. add(float... values)
  2. add(float[] param)
  3. add(long v1, long v2)
  4. add(long val, long augend)
  5. add(Number a, Number b)
  6. add(Object num1, Object num2)
  7. add(String number1, String number2)
  8. add(T a, T b)
  9. add1(Double v1, Double v2)