BigDecimal调用divide()方法时报异常: Non-terminating decimal expansion; no exact representable decimal result.
原因是出现了无限小数,这时候需要定义保留几位小数,
decemal1.divide(decimal2, 6, BigDecimal.ROUND_HALF_UP);

相关文章:

  • 2021-07-30
  • 2022-01-08
  • 2021-11-03
  • 2021-09-21
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2022-01-14
  • 2021-05-31
  • 2022-12-23
  • 2021-06-01
相关资源
相似解决方案