Leading zeros
Zeros at the start of a value that are part of the value, as in the postal code 02134 or the account number 000417.
They disappear when software decides the value is a number, and 02134 becomes 2134. Padding back to a fixed length repairs codes of a known length; for codes of varying length the original is gone.
Where it comes up
- Identifiers that lost their leading zerosA code that starts with zero, such as a postal code or account number, was read as a number and the zeros were dropped.
- Numbers stored as textA column of quantities contains symbols, separators, or words that stop software reading it as numbers.
See also
- IdentifierA value whose job is to name one particular thing, such as an account number, a part number, or a postal code. It is a label, even when it is made entirely of digits.
- Type coercionConverting a value from one data type to another, such as the text 1,200 to the number 1200. It may be requested, or done automatically by software.
- StringA value stored as a sequence of characters, which is to say text. The characters 2025 held as a string are four symbols, not a number.