<html>
<body>
<p id="demo">Click the button to display the formatted number.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var num = new Number(13.3714);
var n = num.toPrecision(2);
var x = document.getElementById("demo");
x.innerHTML=n
}
</script>
</body>
</html>