String of Digits
From Zanecorpwiki
Typed data in languages can sometimes be tricky because you have something that can be a number, but is really a string of digits. The most obvious are "ID numbers" which can lead with zeros. E.g., 000111222 is a perfectly valid account number, but is distinct from 111222 even though the two would be equivalent if treated as a number. But they're not numbers, they're strings of digits.
It used to be that we use these numbers for compressing data. Storing 000111222 takes 4 * 9 bits of data, whereas a classic string takes at least 8 * 9 (ASCII or UTF-8). Now-a-days saving those bits isn't so critical. Clearly using a string for strings of digits that cannot be trivially converted to numbers is the right way to go, and I think there is a good argument for using a string (constrained if possible) even when the legal strings will always map cleanly to numbers. The underlying question really being, "Is this a number, or a string of digits?"


