AvailabilityJavaScript 1.5; JScript 5.5, ECMAScript v3 Synopsisnumber.toExponential(digits) Arguments
ReturnsA string representation of number, in exponential notation, with one digit before the decimal place and digits digits after the decimal place. The fractional part of the number is rounded, or padded with zeros, as necessary, so that it has the specified length. Throws
Examplevar n = 12345.6789; n.toExponential(1); // Returns 1.2e+4 n.toExponential(5); // Returns 1.23457e+4 n.toExponential(10); // Returns 1.2345678900e+4 n.toExponential( ); // Returns 1.23456789e+4 See AlsoNumber.toFixed( ), Number.toLocaleString( ), Number.toPrecision( ), Number.toString( ) |