WenJieWangFlyToWorld

导航

2017年6月21日 #

Java float保留两位小数或多位小数

摘要: 方法1:用Math.round计算,这里返回的数字格式的. 1 2 3 4 float price=89.89; int itemNum=3; float totalPrice=price*itemNum; float num=(float)(Math.round(totalPrice*100)/1 阅读全文

posted @ 2017-06-21 12:06 WenjieWangFlyToWorld 阅读(352) 评论(0) 推荐(0) 编辑