Originally Posted by Flying Mullet
Well you could always use a brute force approach.
1) Treat the input as a string.
2) Go through the input character by character and verify that each character is only 0-9 or a ".".
3) If there is a ".", check that there is only one ".".
4) If there is no decimal and it's a valid number then you have an integer.
5) If there is a decimal, see if there is any number other than zero following it.
6) If there are only zeros, then you have an integer, otherwise it's a float.
It's not as pretty but it would work.