The rule of thumb I teach my students is that it's a number if you plan to do math on it—whether that be incrementing it or multiplying it or making less-than comparisons (with number semantics). If the only thing you ever do with it is use it as a lookup key (or other direct equality comparisons), string might be a better way to think about it. Aside from the input interface issue surfaced in this article, values that are semantically numeric also have the property that they generally can omit leading zeroes (hope you didn't want those New England ZIP codes) or back off to inexact representations when they get large enough (sorry phone numbers whose area code starts with 4 or greater).
Yes, you can work around all of these issues by overriding default number behaviour. But some things that look like numbers are really just strings of digits.
Yes, you can work around all of these issues by overriding default number behaviour. But some things that look like numbers are really just strings of digits.