<html>
<body>
<p id="demo">Click the button to display the fixed number.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var num = 5.56789;
var x = document.getElementById("demo");
x.innerHTML=num.toFixed();
}
</script>
</body>
</html>