// 获取百分比,不带小数点
    private String getPercentage(String num, String total){
        NumberFormat numberFormat = NumberFormat.getInstance();
        numberFormat.setMaximumFractionDigits(2);
        return numberFormat.format( (float)Integer.valueOf(num) / (float)Integer.valueOf(total) * 100 );
    }

  

posted on 2017-10-16 09:42  蛋尼  阅读(516)  评论(0编辑  收藏  举报