JavaScript 번호 toExponential()
실시예 1
숫자를 지수 표기법으로 변환:
let num = 5.56789;
let n = num.toExponential();
정의 및 사용
toExponential() 메서드는 숫자를 지수 표기법으로 변환합니다.
실시예 2
let num = 5.56789;
let n = num.toExponential(3);
통사론
number.toExponential(x)
매개변수
Parameter | Description |
---|---|
x | Optional. An integer between 0 and 20 representing the number of digits in the notation after the decimal point. If omitted, it is set to as many digits as necessary to represent the value |
반환 값
지수 표기법으로 숫자를 나타내는 문자열입니다. |
브라우저 지원
Number.constructor
ECMAScript3(ES3) 기능입니다.
ES3(JavaScript 1999)는 모든 브라우저에서 완벽하게 지원됩니다.
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |