制保留2位小数,如:999999,会在999999后面补上00.即999999.00
function toDecimal2(x) { var f = parseFloat(x); if (isNaN(f)) { return false; } var f = Math.round(x*100)/100; var s = f.toString(); ...