1

有没有办法将数字四舍五入:0.203 到 0.21

现在我这样做:

priceCurrent.toFixed(2);
4

1 回答 1

3

你把这个数字乘以 100,ceil然后除以 100

console.log(Math.ceil(0.203*100)/100)

于 2018-08-17T07:00:30.830 回答