Java examples for java.math:BigDecimal Calculation
multiply two BigDecimal
//package com.java2s; import java.math.BigDecimal; public class Main { public static void main(String[] argv) throws Exception { BigDecimal amount = new BigDecimal("1234"); BigDecimal multiplicand = new BigDecimal("1234"); System.out.println(multiply(amount, multiplicand)); }//w w w .j av a 2s.com /** * ? * * @param amount * @param multiplicand * @return */ public static BigDecimal multiply(BigDecimal amount, BigDecimal multiplicand) { BigDecimal result = new BigDecimal("0.00"); if (amount != null && multiplicand != null) { result = amount.multiply(multiplicand); } return result; } }