sprintf ("%.2f", num) JavaScript中的等效项似乎是 num.toFixed(2) ,格式 num 为2位小数,并四舍五入(但请参阅 Math.round 下面的@ ars265注释)。 (12.345).toFixed(2); ...
確定! 回上一頁