Here you can find the source of multiply(final BigDecimal val1, final BigDecimal val2)
public static final BigDecimal multiply(final BigDecimal val1, final BigDecimal val2)
//package com.java2s; // ProjectForge is dual-licensed. import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static final BigDecimal multiply(final BigDecimal val1, final BigDecimal val2) { if (val1 == null) { if (val2 == null) { return BigDecimal.ZERO; } else { return val2; }/*from w w w . j a va2 s. c om*/ } else if (val2 == null) { return val1; } else { return val1.multiply(val2).setScale(2, RoundingMode.HALF_UP); } } }