Number ऑब्जेक्ट का toExponential() फंक्शन एक स्ट्रिंग लौटाता है जो संख्या को एक्सपोनेंशियल नोटेशन में दर्शाता है।
सिंटैक्स
इसका सिंटैक्स निम्नानुसार है:
num.toExponential(fractionDigits)
उदाहरण
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var num = 77.1234; document.write( num.toExponential(4)); document.write("<br>"); var num = 77.1234; document.write(num.toExponential()); document.write("<br>"); var num = 77.1234; document.write(num.toExponential(0)); </script> </body> </html>
आउटपुट
7.7123e+1 7.71234e+1 8e+1