将double或则float类型保留小数

DecimalFormat df=new DecimalFormat("0.0");//“0.00”

df.format(price);

猜你喜欢

转载自www.cnblogs.com/zuoxh/p/10064912.html