Pergunta de entrevista da empresa Microsoft

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