一种浮点数控制小数位数的方法
- double per = 0.258283;
- DecimalFormat df = (DecimalFormat)NumberFormat.getPercentInstance();
- df.applyPattern("0.00%"); //小数点后保留二位
- String str = df.format(per);
1768

被折叠的 条评论
为什么被折叠?



