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 (ECMA-262) The definition of 'Number.parseFloat' in that specification. |
Living Standard |
브라우저 호환성
BCD tables only load in the browser
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.
같이 보기
- 메서드가 속한
Number
객체. - 전역
parseFloat()
메서드.