improved error handling when converting data to floating point