Here you can find the source of add(BigDecimal a, BigDecimal b)
public static BigDecimal add(BigDecimal a, BigDecimal b)
//package com.java2s; import java.math.BigDecimal; import java.math.RoundingMode; public class Main { private static int scale = 5; public static BigDecimal add(BigDecimal a, BigDecimal b) { return a.add(b).setScale(scale, RoundingMode.HALF_UP); }//from w w w . j ava 2 s. c o m }