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.
Feel free to contact me for any help related to jQuery, I will gladly help you.
var sVal = '234.54';Related Post:
var iNum = parseFloat(sVal); //Output will be 234.54.
- jQuery- Convert string to Integer
- jQuery to round off decimal values
- jQuery Code: Change text to Uppercase
parseFloat(string)If you string contains spaces then only first number will be returned.
var sVal = '23.25 45.25 68';This function will only return "NaN", if the first character cannot be converted to a number.
var iNum = parseFloat(sVal); //Output will be 23.25
Feel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment