字段设置:
<th data-field="wrongpercent" data-align="center" data-formatter="wrongPercent">错误率%
</th>
格式化方法:
function wrongPercent(value
, row
, index) {
var res =
100 * row.wrongnums / row.testnums
;
return [
"<div class='progress'> <div class='progress-bar' role='progressbar' aria-valuenow='50' aria-valuemin='0' aria-valuemax='100' style='width:"+res.
toFixed(
2)+
"%'>"+res.
toFixed(
2)+
"</div> </div>"]
;
// return res.toFixed(2);
}
效果:
转载请注明原文地址: https://www.6miu.com/read-4788.html