parseFloat()

The parseFloat() function parses a string argument and returns a float value.

For example, if a float was stored in a variable as a string, or was taken as string input from a form textbox, you could treat the string as a float by using parseInt():

numberstring= “4.6”;
numberfloat = parseFloat(numberstring);