double f = 111231.035; BigDecimal l = new BigDecimal(f); double c = l.setScale(2, RoundingMode.HALF_UP).doubleValue(); System.out.println("返回值:"+c);
2022-09-30 09:48:12
double f = 111231.035; BigDecimal l = new BigDecimal(f); double c = l.setScale(2, RoundingMode.HALF_UP).doubleValue(); System.out.println("返回值:"+c);