Microsoft Interview Question

Code a function which output an integer or a double when a string representing a number is given as input.