function format(input) { var n = parseFloat(input).toFixed(4); var re = /(\d{1,3})(?=(\d{3})+(?:\.))/g; return n.replace(re, "$1,"); }
时间: 2024-10-07 13:14:19
function format(input) { var n = parseFloat(input).toFixed(4); var re = /(\d{1,3})(?=(\d{3})+(?:\.))/g; return n.replace(re, "$1,"); }