int totalNumber = 5000;
int number = 236
NumberFormat numberFormat = NumberFormat.getInstance(); // 精确到小数点后2位 numberFormat.setMaximumFractionDigits(2); // 去掉逗号 numberFormat.setGroupingUsed(false); String proportion = numberFormat.format((float)number/(float)totalNumber*100);