toFixed (2);. 不利的一面是,像1.5這樣的值將給出“ 1.50”作為輸出。 @minitech建議的修復程序: var numb = 1.5; numb = +numb.toFixed(2); // Note the plus sign ...
確定! 回上一頁