Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to convert a string value to double in java script. is there any function to convert that.. Please suggest.

Also is there any function in java script to check if the value is double or not as we have tryparse.double() in c#..

Please advise on these two issues, Thanks in advance.
Posted

This should help you out: ParseFloat in Javascript[^]
 
Share this answer
 
Comments
Dalek Dave 1-Sep-10 17:16pm    
Good call.
I don't know of a tryparse in javascript, but if you take a string, say it's variable name is v and it's value is "1", then

var dble = v * 1.0;

will convert it. I suspect if v is not a number, dble becomes NaN, but I am guessing, there.
 
Share this answer
 
I think it will help you : parseFloat function in JavaScript^
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900