格式化数字的方法
//改方法用于格式化数字,小数点后面保留4位。
public Double number2(Double pDouble ){
BigDecimal bd = new BigDecimal(pDouble);
BigDecimal bd1 = bd.setScale(4, bd.ROUND_HALF_UP);
pDouble = bd1.doubleValue();
Long ll = Double.doubleToLongBits(pDouble);
return pDouble;
}
public Double number2(Double pDouble ){
BigDecimal bd = new BigDecimal(pDouble);
BigDecimal bd1 = bd.setScale(4, bd.ROUND_HALF_UP);
pDouble = bd1.doubleValue();
Long ll = Double.doubleToLongBits(pDouble);
return pDouble;
}