求百分比
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()) + "%"; }