add is_numeric check to substr()

add is_numeric since those can be implicitly converted to strings
Merge pull request #152 from thedamon/patch-2

add is_numeric check to substr()