Number.parseFloat() 메서드는 문자열을 분석해 부동소수점 실수로 반환합니다.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
구문
Number.parseFloat(string)
매개변수
value- 변환할 값.
반환 값
주어진 값에서 분석한 부동소수점 수. 분석할 수 없으면 NaN.
설명
Number.parseFloat() 메서드는 전역 parseFloat() 함수와 같은 기능을 가지고 있습니다.
Number.parseFloat === parseFloat; // true
Number.parseFloat()는 ECMAScript 2015에서 전역 범위의 모듈화를 위해 추가됐습니다. 상세한 정보와 예제는 parseFloat()를 참고하세요.
폴리필
if (Number.parseFloat === undefined) {
Number.parseFloat = parseFloat;
}
명세
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Number.parseFloat' in that specification. |
Standard | Initial definition. |
| ECMAScript Latest Draft (ECMA-262) The definition of 'Number.parseFloat' in that specification. |
Draft |
브라우저 호환성
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parseFloat | Chrome Full support 34 | Edge Full support 12 | Firefox Full support 25 | IE No support No | Opera Full support 21 | Safari Full support 9 | WebView Android Full support ≤37 | Chrome Android Full support 34 | Firefox Android Full support 25 | Opera Android Full support 21 | Safari iOS Full support 9 | Samsung Internet Android Full support 2.0 | nodejs Full support 0.12 |
Legend
- Full support
- Full support
- No support
- No support
같이 보기
- 메서드가 속한
Number객체. - 전역
parseFloat()메서드.