Problems with converting a String to a float

The first element index in an array is zero so if s does not contain a comma it will return a single element with the array index 0 so try

float temp = float(list[0]);