Reads and returns a float number from a file or terminal