Html page:
<button onclick="myFunction()">Try it</button>
<p id="P9"></p>
Javascript page:
<script>
function myFunction() {
var num = 5.56789;
var n = num.toExponential();
document.getElementById("demo").innerHTML
= n;
}
</script>
Output:
5.56789e+0
No comments:
Post a Comment