def time2float time_string
      if time_string =~ /:/
        hours, minutes = time_string.split(':')
        hours.to_f + (minutes.to_f / 60.0)
      else
        time_string.to_f
      end
    end
def time2float time_string
      if time_string =~ /:/
        hours, minutes = time_string.split(':')
        hours.to_f + (minutes.to_f / 60.0)
      else
        time_string.to_f
      end
    end
Convert from a time span in hour or decimal format to a float.

 @param [String] time_string either "M:MM" or decimal
 @return [#to_f] converted to a floating-point number