原文地址 http://www.cnblogs.com/Dtscal/p/3485405.html
常用方法:
<span style="font-size:18px;">float price=89.89;
int itemNum=3;
float totalPrice=price*itemNum;
float num=(float)(Math.round(totalPrice*100)/100);//如果要求精确4位就*10000然后/10000</span>
原文地址 http://www.cnblogs.com/Dtscal/p/3485405.html
常用方法:
<span style="font-size:18px;">float price=89.89;
int itemNum=3;
float totalPrice=price*itemNum;
float num=(float)(Math.round(totalPrice*100)/100);//如果要求精确4位就*10000然后/10000</span>