datatables表格怎么控制小数点位数?
利用toFixed() 函数
保留小数点后2位
举例:
{
title: "出库数", data: "out_qty_x",
"render": function (data, type, row) {
row.out_qty_x = Number(data).toFixed(2);
return row.out_qty_x;
}
},
datatables表格 大数据 怎样断位数?
$(
'#example'
).dataTable( {
"formatNumber"
:
function
( toFormat ) {
return
toFormat.toString().replace(
/\B(?=(\d{3})+(?!\d))/g,
"'"
);
};
} );