我有一个变量
var fval = 4;
现在我想输出为 4.00
JavaScript 只有一个Number存储浮点值的类型。
没有 int。
Edit:
如果要将数字格式化为小数点后两位数字的字符串,请使用:
(4).toFixed(2)