English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript toExponential() Method

 JavaScript Number Object

toExponential()The method returns a string representing a Number object in exponential notation.

Syntax:

number.toExponential(fractionDigits)
var num = 15;
num.toExponential();
Test and see‹/›

Browser Compatibility

All browsers fully support the toExponential() method:

Method
toExponential()IsIsIsIsIs

Parameter Value

ParameterDescription
fractionDigits(Optional) An integer, specifying the number of digits after the decimal point

Technical Details

Return value:A string, representing the number in exponential notation
Exception cases:
  • RangeError-If fractionDigits is too small or too large. 0 to2values between 0 and20) will not cause a RangeError

  • TypeError-If this method is called on a non-Number object

JavaScript Version:ECMAScript 3

More Examples

Convert a number to exponential notation:

var num = 15;
num.toExponential(6);
Test and see‹/›

 JavaScript Number Object