NumberFormat percent = NumberFormat.getPercentInstance(); percent.setMaximumFractionDigits(2); //保留多少位 String result = percent.format(res.getFloat("score")).toString();
NumberFormat percent = NumberFormat.getPercentInstance(); percent.setMaximumFractionDigits(2); //保留多少位 String result = percent.format(res.getFloat("score")).toString();
转载于:https://www.cnblogs.com/znsongshu/p/10177318.html