Java web项目开发中,BigDecimal类型的数据,保留小数位数:(new BigDecimal(quantity)).setScale(2, BigDecimal.ROUND_HALF_UP);