double f = 111231.035; BigDecimal l = new BigDecimal(f); double c = l.setScale(2, RoundingMode.HALF_UP).doubleValue(); System.out.println("返回值:"+c);
时间: 2024-12-19 04:45:58
double f = 111231.035; BigDecimal l = new BigDecimal(f); double c = l.setScale(2, RoundingMode.HALF_UP).doubleValue(); System.out.println("返回值:"+c);