Home

Published

- 1 min read

how to make a 2 value after point javascript

img of how to make a 2 value after point javascript

The solution for this is noted below

how to make a 2 value after point javascript

Solution

   var num1 = parseFloat('10.547892')
var num2 = parseFloat('10.547892').toFixed(2)
console.log('Without using toFixed() method')
console.log(num1)
//10.547892
console.log('Using toFixed() method')
console.log(num2)
//10.55

Try other methods by searching on the site. That is if this doesn’t work