JS Built-ins
NumbertoExponentialintermediate

toExponential() β€” with 3 decimal places

πŸ“– Usage Example
// Format number in exponential notation
(12345).toExponential(2)    // β†’ '1.23e+4'
(0.00123).toExponential(1)  // β†’ '1.2e-3'

Use toExponential() to express a number in scientific notation, useful when displaying very large or very small values.

toExponential(3)

(1).toExponential(3) pads with zeros to show 3 fractional digits.

πŸ’‘ Hints (1)
  • β€’ `toExponential` pads with trailing zeros when needed.