DecimalFormat format = (DecimalFormat) NumberFormat.getPercentInstance();
format.applyPattern("#####0");
double strCell = aCell.getNumericCellValue();
String temp = format.format(strCell);
----------------------方法2-------------------------
com.bstek.common.lang.convert.ConverterUtils.FORCE.convert
format.applyPattern("#####0");
double strCell = aCell.getNumericCellValue();
String temp = format.format(strCell);
----------------------方法2-------------------------
com.bstek.common.lang.convert.ConverterUtils.FORCE.convert
本文详细介绍了Java中使用DecimalFormat进行数值格式化的方法,包括百分比格式化及强制类型转换的应用,提供了实例代码演示。
2267

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



