javascript html add
Tue Aug 24 2021 06:52:41 GMT+0000 (Coordinated Universal Time)
Saved by
@rushiithombre
#javascript
const a = parseInt(prompt('enter 1 no '));
const sum = Math.sqrt(a);
console.log(sum);
document.getElementById('root').innerHTML =`<h1> ${sum} </h1>`;
---------------------------------------------------
precision code
4.1
3.3000000000000003
7.789999999999999
3
0.3666666666666667
If you don’t want or need the precision shown above, you can format a number to a
fixed precision:
var x = 3;
var y = 1.1;
var z = x * y;
print(z.toFixed(2)); // displays 3.30
content_copyCOPY
Comments