求百分比

String successlv ="";
    Long allcount = Long.parseLong(listsqlAllCount.get(0).toString());
    Long successcount = Long.parseLong(listsqlSuccessCount.get(0).toString());
    
    DecimalFormat df = new DecimalFormat("#######0.00");
    if(allcount==null){
        successlv="0.00%";
    }else{
        successlv = df.format((float)(successcount.longValue() * 100L) / (float)allcount.longValue()) + "%";
    }

 

posted @ 2012-09-25 11:13  合肥房屋托管  阅读(143)  评论(0编辑  收藏  举报