ROUND_UP
截断的小数>0时进一位
//ROUND_UP
BigDecimal zero = new BigDecimal("1.0750000");
BigDecimal one = new BigDecimal("1.0750001");
BigDecimal two = zero.setScale(3,BigDecimal.ROUND_UP);
BigDecimal three = one.setScale(3,BigDecimal.ROUND_UP);
System.out.println("two="+two); //two=1.075
System.out.println("three="+three); //three=1.076
ROUND_DOWN
直接舍弃截断的小数,不在小数位上进一位,不管舍弃的数值有多大
BigDecimal zero = new BigDecimal("1.0740000");
BigDecimal one = new BigDecimal("1.0790001");
BigDecimal two = zero.setScale(2,BigDecimal.ROUND_DOWN);
BigDecimal three = one.setScale(2,BigDecimal.ROUND_DOWN);
System.out.println("two="+two);
System.out.println("th