코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Predefined Function</title> </head> <body> <h1>parseFloat() 함수</h1> <script> document.write(parseFloat("123") + "<br>"); document.write(parseFloat("123.000") + "<br>"); document.write(parseFloat("123.456") + "<br>"); document.write(parseFloat("12 34 56") + "<br>"); document.write(parseFloat(" 123 ") + "<br>"); document.write(parseFloat("123 초콜릿") + "<br>"); document.write(parseFloat("초콜릿 123")); </script> </body> </html>