Checking to see if a string is an integer or float
If the string is convertable to integer, it should be digits only. It should be noted that this approach, as @cwallenpoole said, does NOT work with negative inputs beacuse of the ‘-‘ character. You could do: If you already have Number confirmed as a float, you can always use is_integer (works with negatives):