Here you can find the source of subtract(BigDecimal a, BigDecimal b)
public static BigDecimal subtract(BigDecimal a, BigDecimal b)
//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 }