Introduction:
Find code to convert String to float or double using jQuery. To convert,
use JavaScript parseFloat() function parses a string and returns a
floating point number.
Example:
var sVal = '234.54'; var iNum = parseFloat(sVal); //Output will be 234.54.
If you string contains spaces then only first number will be returned.
var sVal = '23.25 45.25 68'; var iNum = parseFloat(sVal); //Output will be 23.25
0 comments :
Post a Comment