📜  javascript 2 位小数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:55.042000             🧑  作者: Mango

代码示例6
var myNumber = 2;

myNumber.toFixed(2); //returns "2.00"
myNumber.toFixed(1); //returns "2.0"