d为数字 //四舍五入var roundDecimal = function (val, precision) { return Math.round(Math.round(val * Math.pow(10, (precision || 0) + 1)) / 10) / Math.pow(10, (precision || 0));}//1,111,111.00d.toFixed(2).toString().replace(/\B(?=(\d{3
//四舍五入 var roundDecimal = function (val, precision) { return Math.round(Math.round(val * Math.pow(10, (precision || 0) + 1)) / 10) / Math.pow(10, (precision || 0)); } //1,111,111.00 d.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");