BigDecimal.prototype.toExponential

Returns a string representation of the BigDecimal in exponential notation rounded to the specified number of digits after the decimal point.

Syntax

toExponential(digits, roundingMode)

Parameters

Return value

A string representing the value in exponential notation.

Examples

123.4567m.toExponential(1)
"1.2e+2"
123.4567m.toExponential(3)
"1.235e+2"
123.4567m.toExponential(3, "down")
"1.234e+2"