计算百分比方法,取几位数,括号里面的参数留几个0就行了 String result = new DecimalFormat("0.00").format((float) size / total * 100);