1.直接舍去
String s="125.67";
BigDecimal b = new BigDecimal(s);
b=b.setScale(1, BigDecimal.ROUND_DOWN);
System.out.println(b);//结果:125.6
2.四舍五入
String s="125.64";
BigDecimal b = new BigDecimal(s);
b=b.setScale(1, BigDecimal.ROUND_HALF_UP);
System.out.println(b);//结果:125.6
String s="125.65";
BigDecimal b = new BigDecimal(s);
b=b.setScale(1, BigDecimal.ROUND_HALF_UP);
System.out.println(b);//结果:125.7
3.BigDecimal加减乘除
BigDecimal add(BigDecimal augend)
BigDecimal subtract(BigDecimal subtrahend)
BigDecimal multiply(BigDecimal multiplicand)
BigDecimal divide(BigDecimal divisor)