Amos的随笔

Java/Python/Go,软件测试等等

导航

2018年7月27日 #

BigDecimal转int数据四舍五入

摘要: new BigDecimal("6749.13") .multiply(new BigDecimal("1.5")) .intValue(); 解析: 6749.13 * 1.5 = 10123.695 实际结果=10123,可见intValue是截取小数的。 故在将BigDecimal转int时需 阅读全文

posted @ 2018-07-27 11:18 AmosChen 阅读(83) 评论(0) 推荐(0)