/** * 转换double为百分数,保留两位小数 * @param doub * @return */ public String parseDoubleToPercent(double doub) { NumberFormat nf = NumberFormat.getPercentInstance(); nf.setMaximumFractionDigits(2); nf.setMinimumFractionDigits(2); return nf.format(doub); }