Baseline Widely available
toExponential()
ë©ìëë ì«ì를 ì§ì í기ë²ì¼ë¡ íê¸°í´ ë°íí©ëë¤.
function expo(x, f) {
return Number.parseFloat(x).toExponential(f);
}
console.log(expo(123456, 2));
// Expected output: "1.23e+5"
console.log(expo("123456"));
// Expected output: "1.23456e+5"
console.log(expo("oink"));
// Expected output: "NaN"
구문
numObj.toExponential([fractionDigits]);
매ê°ë³ì
fractionDigits
Optional
ììì ì´íë¡ ííí ì릿ìì ëë¤. 기본ê°ì 주ì´ì§ ê°ì ëíë´ëë° íìí ì릿ìì ëë¤.
주ì´ì§ Number
ê°ì ì«ì íì리ì ììì , ììì ì´í fractionDigits
ì릿ìë§í¼ ë°ì¬ë¦¼íì¬ ì§ì í기ë²ì¼ë¡ ëíë¸ ë¬¸ìì´ì ë°íí©ëë¤.
RangeError
fractionDigits
ê° ë무 ìê±°ë ë무 í¬ë©´ RangeError
ìë¬ê° ë°ìí©ëë¤. fractionDigits
ê° 0ìì 20 ì¬ì´ì ê°ì´ë©´ RangeError
ìë¬ë ë°ìíì§ ììµëë¤. 구íì ë°ë¼ ë í¬ê±°ë ìì ê°ë ì¬ì© í ì ììµëë¤.
TypeError
Number
ê° ìë ê°ì²´ê° ì´ ë©ìë를 ì¤íìí¤ë©´ RangeError
ìë¬ê° ë°ìí©ëë¤.
fractionDigits
매ê°ë³ì를 ìëµíë©´, 기본ì ì¼ë¡ 주ì´ì§ ê°ì í¹ì í기 ìí´ íìí ì릿ìë§í¼ì´ ììì ì´í ì릿ìê° ë©ëë¤.
ì§ìë ììì ì´ ìë ì«ì 리í°ë´ì toExponential()
ë©ìë를 ì¬ì©íë ¤ë©´, ì ìì 공백ì ëì´ ì ì´ ììì ì¼ë¡ í´ìëë ê²ì ë§ëë¡ í©ëë¤.
주ì´ì§ ê°ì ì릿ìê° fractionDigits
매ê°ë³ìë³´ë¤ í¬ë¤ë©´, 주ì´ì§ ê°ì fractionDigits
ì ê°ê¹ì´ ì릿ìë¡ ë°ì¬ë¦¼ëì´ ííë©ëë¤. toFixed()
ë©ìëì ë°ì¬ë¦¼ì ê´í ì¤ëª
ì´ toExponential()
ë©ìëìë ë§ì°¬ê°ì§ë¡ ì ì©ë©ëë¤.
toExponential
ì¬ì©í기
var numObj = 77.1234;
console.log(numObj.toExponential()); // logs 7.71234e+1
console.log(numObj.toExponential(4)); // logs 7.7123e+1
console.log(numObj.toExponential(2)); // logs 7.71e+1
console.log((77.1234).toExponential()); // logs 7.71234e+1
console.log((77).toExponential()); // logs 7.7e+1
ëª
ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
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