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