JavaScript parseFloat() Function | js parseint parsefloat
![JavaScript parseFloat() Function](https://i.imgur.com/axBPWDg.jpg)
ExamplesParsedifferentvalues:parseFloat(10);parseFloat("10");parseFloat("10.33");parseFloat("344566");parseFloat("Hewas40");TryitYourself»[1]Moreexamplesbelow.DefinitionandUsageTheparseFloat()methodparsesavalueasastringandreturnsthefirstnumber.NotesIfthefirstcharactercannotbeconverted,NaNisreturned.Leadingandtrailingspacesareignored.Onlythefirstnumberfoundisreturned.SyntaxParametersParameterDescriptionvalueRequired.Thevaluetoparse.ReturnValueTypeDescriptionAnumberNaNifnonumberisfound.Browser...
![JavaScript parseFloat() Function](http://pix4.agoda.net/hotelimages/4172139/0/24097f8fc1c9959ea5062e8d6497eaad.jpg?s=800x)
Parse different values:
parseFloat(10);parseFloat("10");parseFloat("10.33");parseFloat("34 45 66");parseFloat("He was 40");
Try it Yourself »[1]More examples below.
Definition and UsageThe parseFloat() method parses a value as a string and returns the first number.
NotesIf the first character cannot be converted, NaN is returned.
Leading and trailing spaces are ignored.
Only the first number found is returned.
Syntax Parameters Parameter Description value Required.The value to parse. Return Value Type Description A numberNaN if no number is found. Browser SupportparseFloat() is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome Edge Firefox Safari Opera IE Yes Yes Yes Yes Yes Yes More ExamplesParse different values:
parseFloat("40.00");parseFl...
取得本站獨家住宿推薦 15%OFF 訂房優惠
本站住宿推薦 20%OFF 訂房優惠,親子優惠,住宿折扣,限時回饋,平日促銷
認識parseInt、parseFloat 與Number 轉換成數字的三種方法 ... | js parseint parsefloat
parseInt() - JavaScript 參考文件 | js parseint parsefloat
parseFloat() | js parseint parsefloat
parseFloat - JavaScript 标准内置对象 | js parseint parsefloat
詳解js中Number()、parseInt()和parseFloat()的區別 | js parseint parsefloat
parseInt()、parseFloat() 與Number() | js parseint parsefloat
使用parseFloat()、parseInt()、Number() 轉換型別 | js parseint parsefloat
difference between parseInt() and parseFloat() | js parseint parsefloat
JavaScript parseFloat() Function | js parseint parsefloat
详解JS中Number()、parseInt()和parseFloat()的区别 | js parseint parsefloat
![](https://i.imgur.com/axBPWDg.jpg)