-
java中如何使float类型数据保留两位小数
方法1:用Math.round计算,这里返回的数字格式的float price=89.89;int itemNum=3;float totalPrice=price*itemNum;float num=(float)(Math.rou
方法1:用Math.round计算,这里返回的数字格式的float price=89.89;int itemNum=3;float totalPrice=price*itemNum;float num=(float)(Math.rou