코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Number Method</title> </head> <body> <h1>toExponential() 메소드</h1> <script> var num = 12.3456; // Number 인스턴스를 생성함. document.write(num.toExponential() + "<br>"); // 1.23456e+1 document.write(num.toExponential(2) + "<br>"); // 1.23e+1 document.write(num.toExponential(4) + "<br>"); // 1.2346e+1 document.write(12.3456.toExponential()); // 1.23456e+1 </script> </body> </html>