Just a detail that might interest paki. isnum reports "true" in cases like -100, 1.234, -1.234, ie it checks whether the entire v2 argument is a number, not whether it contains only digits. To check the latter, one could use
if ($regex(<string>,/^\d+$/))
or
if (<string> isnum 0- && . !isin <string> && <string> != -0)