3 ms·
No point in over-complicating things. If serial `00001` and `1` are meant to be different, then store it as a string. If they would definitely refer to the same
by metaloha 5y ago
No point in over-complicating things. If serial `00001` and `1` are meant to be different, then store it as a string. If they would definitely refer to the same item, strip the leading zeroes for storage (and comparisons!) and keep it as a string.
I go with string because serial numbers, despite having the word "number" in the phrase, are not necessarily numeric. Hexadecimal numbers have letters (for example), but we still call them "numbers" ;)