- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to force a number to display in exponential notation?
Use the toExponential() method to force a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation.
The following is the parameter −
- fractionDigits - An integer specifying the number of digits after the decimal point. Defaults to as many digits as necessary to specify the number.
Example
You can try to run the following code to force a number to display in exponential function −
<html> <head> <title>Javascript Method toExponential()</title> </head> <body> <script> var num=77.1234; var val = num.toExponential(); document.write("num.toExponential() is : " + val ); document.write("<br />"); val = num.toExponential(4); document.write("num.toExponential(4) is : " + val ); document.write("<br />"); val = num.toExponential(2); document.write("num.toExponential(2) is : " + val); document.write("<br />"); val = 77.1234.toExponential(); document.write("77.1234.toExponential()is : " + val ); document.write("<br />"); val = 77.1234.toExponential(); document.write("77 .toExponential() is : " + val); </script> </body> </html>
- Related Articles
- How to display numbers in scientific notation in Java?
- How to convert a String containing Scientific Notation to correct JavaScript number format?
- MongoDB query to group records and display a specific value with dot notation
- Explain exponential form of a number.
- How to find exponential value in Python?
- How to round exponential numbers in R?
- How to display Absolute value of a number in C#?
- How to do exponential calculation to a range of cells in Excel?
- How to create an exponential curve in R?
- Negative 216 / 343, how to write in exponential form ?
- How to create an exponential distribution plot in R?
- Get exponential value of a number using Math.exp in Java
- How to deactivate scientific notation of numbers in R?
- How to prevent numbers being changed to exponential form in Python Matplotlib?
- The distance between the earth and the moon is approximately 384000 km. Express the distance in meters in exponential notation.

Advertisements