Convert a number into an exponential notation:
The result of n will be:
More "Try it Yourself" examples below.
The toExponential() method converts a number into an exponential notation.
Method | |||||
---|---|---|---|---|---|
toExponential() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
x | Optional. An integer between 0 and 20 representing the number of digits in the notation after the decimal point. If omitted, it is set to as many digits as necessary to represent the value |
Return Value: | A String, representing the number as an exponential notation |
---|---|
JavaScript Version: | 1.5 |
Convert a number into an exponential notation:
The result of n will be: