BigDecimal 取小数位 code:long a = 1;long b = 10;BigDecimal aa = new BigDecimal(a);BigDecimal bb = new BigDecimal(b);//取3位小数aa.divide(bb).setScale(3, BigDecimal.ROUND_HALF_DOWN).toString() java 2023-06-10 42 点赞 0 评论 63 浏览