BigDecimal result = new BigDecimal(doubleValue).multiply(factor2);
public class Payment { BigDecimal itemCost; BigDecimal totalCost; // You can initialize it if you wish. public BigDecimal calculateCost(int itemQuantity, BigDecimal itemPrice) { itemCost = itemPrice.multiply(new BigDecimal(itemQuantity)); totalCost = totalCost.add(itemCost); return totalCost; } }