[quote]自动转换为百分比的形式[/quote]
[quote]科学计数法转换为正常数值[/quote]
public static String getDoubleNumPercent(Double doub) throws Exception {
java.text.NumberFormat percentFormat = java.text.NumberFormat.getPercentInstance();
percentFormat.setMaximumFractionDigits(2);
String str = percentFormat.format(doub);// 自动转换成百分比显示..
return str;
}
[quote]科学计数法转换为正常数值[/quote]
public static String getIntNum(Integer d) throws Exception {
DecimalFormat format = new DecimalFormat();
format.setGroupingSize(0);
return format.format(d);
}