A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Number/toExponential below:

toExponential · WebPlatform Docs

toExponential Summary

The toExponential() method formats a number to exponential notation.

Syntax
toExponential([ fractionDigits ])
fractionDigits
Optional. The number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
Return Value

Returns a string representation of a number in exponential notation. The string contains one digit before the decimal point, and may contain fractionDigits digits after it.

If fractionDigits is not supplied, the toExponential method returns as many digits necessary to uniquely specify the number.

Examples

Using toExponential to format the text presentation of a number.

var pie = 3.14159;

pie.toPrecision();


pie.toPrecision(3);


pie.toPrecision(1);


pie.toPrecision(0);

Remarks Throws

RangeError when a fractionDigits outside the bounds of 0 - 20 (inclusive) was given.

See also Other articles External resources Specification

15.7.4.6 Number.prototype.toExponential(fractionDigits)

ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011

Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4