JavaScript Numbers
JavaScript has only one type of number. Numbers can be written with or without decimals. Example var x = 123e5; // 12300000 var y = 123e-5; // 0.00123 Code#00:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<!DOCTYPE html> <html> <title>JavaScript Numbers</title> <body> <h2>JavaScript Numbers</h2> <p>Extra large or extra small numbers can be written with scientific (exponent) notation:</p> <p id="MWC"></p> <script> var x = 123e5; var y = 123e-5; document.getElementById("MWC").innerHTML = x + "<br>" + y; </script> </body> </html> |
Output: …