Extra large or extra small numbers can be written with scientific (exponent) notation.
Code:-
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- </head>
- <body>
- <h1>Extra Number</h1>
- <input type="button" onclick="exnumber();" value="Get Answer">
- <script>
- function exnumber()
- {
- var n1 = 569e10;
- var n2 = 32e-5;
- alert(n1); //add extra zero on righ side
- alert(n2); //add extra zero on left side
- }
- </script>
- </body>
- </html>
How to use extra small number in JavaScript:- Geniusofstudent
Reviewed by Network security
on
July 02, 2019
Rating:
No comments: