layui 统计行totalRow 保留两位小数
done(data,curr, count){ var tableView = this.elem.next(); var totalRow = tableView.find('.layui-table-total'); layui.each(totalRow.find('td'), function (index, tdElem) { tdElem = $(tdElem); var text = tdElem.text(); if (text && !isNaN(text)) { text = parseFloat(text).toFixed(2); //此处为小数点后个数 tdElem.find('div.layui-table-cell').html(text); } }); }