return num && (num.toString().indexOf('.') != -1 ? num.toString().replace(/(\d)(?=(\d{3})+\.)/g,
function($0, $1) {
return $1 + ","
}) : num.toString().replace(/(\d)(?=(\d{3}))/g, function($0, $1) {
return $1 + ","
}))
}
console.log(ce(1353400.23))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)