There is int.parse, double.parse but no num.parse. It should return an int if the string could be the output of ints (or if it's a hexadecimal literal), and otherwise return a double.