Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法将数字四舍五入:0.203 到 0.21
现在我这样做:
priceCurrent.toFixed(2);
你把这个数字乘以 100,ceil然后除以 100
ceil
console.log(Math.ceil(0.203*100)/100)