+ 1
Code for javascript
how to round to 2 decimal places ,,, if the 3nd decimal is equal to 5 ( if the 2nd decimal is even, the 2nd decimal number is increased by 1 and if the even number is fixed) // example : 2.215 = 2.22 and 2.245 = 2.24
2 Answers
+ 3
console.log( Number(parseFloat("123.456").toFixed(2)) );
// or
console.log( Math.round( 123.456 * 100 ) / 100 );
+ 1
Thanks for help me this code working SoloProg đ