+ 1
[SOLVED] How to round the float number
I want to round number from 10.6999 to be 10.70 but when i am using Math.round function i got 11 My question is how to round number from 10.6999 to 10.70 in javascript https://code.sololearn.com/W4rX2Q09Ft15/?ref=app
3 Antworten
0
You can try like:
console.log(Math.round(number*100)/100);
0
Already solved it with toFixed() function man,
But your solution are working too
0
Yes. That also works..
edit:
number.toFixed(2); just got it