Die Number.parseFloat()
Methode liest ein String-Argument ein und gibt eine Fließkommazahl zurück. Diese Methode verhält sich identisch zu der globalen Funktion parseFloat()
und ist Teil von ECMAScript 2015 (das Ziel ist die modularisierung von globalen Funktionen).
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.
Syntax
Number.parseFloat(string)
Parameter
value
- Der Wert, den man parsen möchte.
Rückgabewert
Eine Fließkommazahl, die vom übergebenen Wert geparst wurde. Wenn der Wert nicht zu einer Zahl konvertiert werden kann, wird NaN
zurückgegeben.
Beschreibung
Mehr Details und Beispiele sind im Artikel parseFloat()
nachzuschlagen.
Polyfill
Number.parseFloat = parseFloat;
Spezifikationen
Spezifikation | Status | Kommentar |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) Die Definition von 'Number.parseFloat' in dieser Spezifikation. |
Standard | Initiale Definition. |
ECMAScript (ECMA-262) Die Definition von 'Number.parseFloat' in dieser Spezifikation. |
Lebender Standard |
Browserkompatibilität
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.