JS浮点数保留小数点2位数 2018-08-22 本文已影响0人 风越大心越荡 JS浮点数保留小数点2位数 function (num) { return (Math.round(parseFloat(num)*100)/100).toFixed(2); }