Correcting the calls to convert string to float in js