BigDecimal dd = new BigDecimal(2323.232323);
          dd.setScale(3, BigDecimal.ROUND_HALF_UP);3是要保留的位数,后面那个常数是保留的方法,有很多种,自己看看javadoc吧