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;
     }
 }

相关文章:

  • 2021-05-31
  • 2021-12-09
  • 2022-01-21
  • 2021-12-29
  • 2022-01-04
  • 2022-01-31
猜你喜欢
  • 2021-03-26
  • 2022-02-20
  • 2022-12-23
  • 2021-12-10
  • 2022-01-27
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案