JavaScript/Number:修订间差异
来自康健生活
| 第7行: | 第7行: | ||
</pre>}}}} | </pre>}}}} | ||
=== toFixed === | === toFixed === | ||
舍入规则 Number.prototype.toFixed ( fractionDigits )<ref>https://262.ecma-international.org/6.0/#sec-number.prototype.tofixed</ref>。 | |||
{{leftrightflex|<syntaxhighlight lang="javascript"> | {{leftrightflex|<syntaxhighlight lang="javascript"> | ||
(new Number(100.345)); | (new Number(100.345)); | ||
2022年1月19日 (三) 14:21的版本
引言
四舍五入
Math.round
toFixed
舍入规则 Number.prototype.toFixed ( fractionDigits )[1]。 模板:Leftrightflex
自定义
No categories