商品单价价格是单位是(分),用户下单金额=商品单价*折扣  代码如下

Integer discount = 5 折扣五折

Integer orderPrice = 1000  单位分

BigDecimal bigDecimal = new BigDecimal(discount * 0.1 + "");
BigDecimal multiply = bigDecimal.multiply(new BigDecimal(orderPrice));
orderPrice = multiply.setScale(0, BigDecimal.ROUND_HALF_UP).intValue();

 

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2021-12-17
  • 2021-12-13
  • 2021-08-26
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2021-12-17
  • 2022-02-27
  • 2021-05-30
  • 2021-03-31
  • 2021-12-19
相关资源
相似解决方案