---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Number.prototype.toExponential()

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

## Syntax

```js
toExponential()
toExponential(fractionDigits)
```

### Parameters

- `fractionDigits` _**optional**_
  - : Optional. An integer specifying the number of digits after the decimal point.
    Defaults to as many digits as necessary to specify the number.

### Return value

A string representing the given `Number` object in exponential notation
with one digit before the decimal point, rounded to
`fractionDigits` digits after the decimal point.

### Exceptions

- [`RangeError`](../../../globals/RangeError/RangeError.mdx)
  - : If `fractionDigits` is too small or too large. Values between
    `0` and `100`, inclusive, will not cause a
    [`RangeError`](../../../globals/RangeError/RangeError.mdx).
- [`TypeError`](../../../globals/TypeError/TypeError.mdx)
  - : If this method is invoked on an object that is not a `Number`.

## Description

If the `fractionDigits` argument is omitted, the number of digits
after the decimal point defaults to the number of digits necessary to represent the
value uniquely.

If you use the `toExponential()` method for a numeric literal and the
numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot
that precedes the method call to prevent the dot from being interpreted as a decimal
point.

If a number has more digits than requested by the
`fractionDigits` parameter, the number is rounded to the nearest
number represented by `fractionDigits` digits. See the discussion
of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`.
