Non-terminating decimal expansion; no exact representable decimal result.
BigDecimal调用divide()方法时报异常: Non-terminating decimal expansion; no exact representable decimal result.
原因是出现了无限小数,这时候需要定义保留几位小数,
decemal1.divide(decimal2, 6, BigDecimal.ROUND_HALF_UP);
hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » Non-terminating decimal expansion; no exact representable decimal result.
自学咖网 » Non-terminating decimal expansion; no exact representable decimal result.