1// parseFloat takes in a string value and converts it to a float
2// The parseFloat function will look at the first character of
3// the string and decided whether that character is a number or not
4// If not the parseFloat function will return Nan
5
6let stringNumber = "8.0"
7
8let floatNuumber = parseFloat(stringNumber);
1 var subtotal = parseFloat(val) + parseFloat(tax) + parseFloat(imp) + parseFloat(env);
2 var subtotal = subtotal.toFixed(2); //two decimal places
1var string = "10";
2var float = parseFloat(string);
3console.log(typeof(float)); // float
1//do do this use parseFloat()
2//it turns a string into a float in js
3//you can later use this for animation
4var string = "10"
5string = parseFloat(string)
6console.log(string)