将double或则float类型保留小数

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

df.format(price);

posted @ 2018-12-04 16:27  帅的很耗cpu  阅读(153)  评论(0编辑  收藏  举报