JavaScript/Number

来自康健生活
Kangkk​(留言 | 贡献)2022年3月11日 (五) 08:31的版本 (→引言)

引言

模板:Leftrightflex

四舍五入

Math.round

模板:Leftrightflex

toFixed

舍入规则 Number.prototype.toFixed ( fractionDigits )[1]。 模板:Leftrightflex

自定义

模板:Leftrightflex

  1. ↑ Ecma International.ECMAScript® 2015 Language Specification:Number.prototype.toFixed ( fractionDigits )[S]:2015