Advertisement
Data Processing

Locale Collision: The Number That Arrives One Thousand Times Too Small

Every data team has a rule for reading numbers, whether they wrote it down or not. Comma means thousands, dot means decimal, and the file moves on. That...

Every data team has a rule for reading numbers, whether they wrote it down or not. Comma means thousands, dot means decimal, and the file moves on. That rule works beautifully until a file arrives from a system that follows the opposite convention, where the dot groups the thousands and the comma carries the decimals. Nothing in the characters themselves announces which convention produced them. The string looks ordinary, the parser succeeds, and the value that lands in the database can be a thousandth of the value the sender meant. No error is raised, because from the parser's point of view nothing went wrong. It read a well-formed number. It simply read it in the wrong language.

Locale Collision: The Number That Arrives One Thousand Times Too Small

The stakes are easiest to see in money and measurement, where a factor of one thousand is not a rounding issue but a different reality: a payment, a weight, or a dosage recorded at one-thousandth of its true size, flowing into totals, thresholds, and alerts that all trust it. This article isolates that failure with a controlled test. Three groups of numeric strings, each written under a different convention or readable under two, were all fed through a single parsing rule. The question is not whether a mismatched rule can misread a value. It is how completely it misreads, whether the error is uniform enough to detect after the fact, and how much of a mixed file is even decidable without knowing where each row came from.

What the numbers show

The test file held 900 numeric strings in three groups of 300. The first group used the en-US form, with a comma as the thousands separator and a dot as the decimal point, as in 1,234.56. The second group rendered the same underlying values in the de-DE form, with a dot for thousands and a comma for decimals, as in 1.234,56. The third group used an ambiguous form, as in 1.234, which can be read as one thousand two hundred thirty-four or as a decimal value just above one. Every string was then parsed under one rule only: the en-US rule (Source: SmartDataAI import test T6, run 2026-11-23; the script and result JSON sit in the batch evidence pack).

The home group survived untouched. All 300 of the 300 en-US strings parsed correctly and round-tripped to their true values, a correct rate of 100% for that group. That result is expected, but it is also the trap: a pipeline tested only against files written in its own convention will show a perfect score right up until the first foreign file arrives.

The de-DE group failed completely. All 300 of the 300 de-DE strings were misread under the en-US rule (Source: SmartDataAI import test T6, run 2026-11-23; the script and result JSON sit in the batch evidence pack). The misread was not scattered or partial. For every one of the 300 values, the ratio of the true value to the parsed value was 1000.0, meaning each value came back at roughly one-thousandth of its true size. The uniformity cuts both ways. On one side, a perfectly consistent error is at least detectable in aggregate: a column whose values suddenly sit three orders of magnitude below expectation is visible to anyone who looks at distributions rather than row counts. On the other side, uniformity means there is no lucky subset. A mismatched locale rule does not damage some rows and spare others by chance. It converts the entire group, silently and consistently, into wrong numbers that agree with each other.

The ambiguous group is the quiet third of the problem. Those 300 strings are 33.33% of the 900-string file, and for them the question of correctness cannot even be settled from the string alone. A value like 1.234 carries no internal evidence of which reading its author intended. Any single rule will produce an answer, and the answer will look exactly like a successful parse. Deciding these values requires provenance: which system, which country setting, which export produced the row. Without that, a third of this file is not parsed so much as guessed, and the guess is invisible in the output.

Combining the decidable groups gives the headline rate. Excluding the ambiguous group, the correct parse rate was 50.0% (derived: (300+0)/600), because the en-US group scored 300 correct and the de-DE group scored zero correct out of the 600 strings whose true reading is known. Count the ambiguous strings as wrong, and the rate over the full file falls to 300 of 900, or 33.33%. Either way, a single-rule parser applied to a mixed-convention file does not degrade gracefully. It is exactly right for its own convention, exactly wrong for the opposing one, and undecidable for the rest.

What Locale Collision means

Locale Collision is the systematic misreading that occurs when numeric strings written under one regional convention for thousands and decimal separators are parsed under a different convention, producing values that are well-formed, plausible, and wrong by a consistent factor. Three properties define it. First, the error is convention-shaped, not random: in the test it struck 300 of 300 strings from the mismatched group and none from the matched group. Second, the error magnitude is structured: the true-to-parsed ratio held at 1000.0 across the whole mismatched group, because swapping the roles of the two separators moves the decimal point by exactly the grouping distance. Third, a residue of strings is ambiguous in principle, readable under both conventions with no internal way to choose, so no parser, however careful, can resolve them without provenance. Locale Collision is therefore not a parsing bug in the usual sense. The parser does exactly what it was told. The collision is between two correct conventions meeting in one file under one rule.

Questions, answered

How large is the error when conventions collide?

In this test, uniform and severe: all 300 de-DE values were misread, each at a true-to-parsed ratio of 1000.0 (Source: SmartDataAI import test T6, run 2026-11-23; the script and result JSON sit in the batch evidence pack). A value does not come back slightly off. It comes back three orders of magnitude small, consistently, across the whole group.

Can a parser detect the collision on its own?

For clearly grouped strings, only with extra signals, such as checking both readings against plausible ranges for the column. For the ambiguous group, which was 33.33% of this file, no: a string like 1.234 does not contain the information needed to choose a reading. Provenance about the producing system has to travel with the data.

What is the practical defence?

Record the locale of every incoming file as metadata at intake, parse under that locale rather than a global default, and quarantine strings that remain ambiguous under the declared locale. The test's 50.0% correct rate on decidable strings (derived: (300+0)/600) is what a single global rule buys on a mixed file; per-source locale handling is what removes the mismatched group from the error column entirely.

How this was measured

The honesty of these numbers depends on their scope, so the method is stated in full. Values were not copied from a production ledger: a test script constructed synthetic dirty data, fixing the seed at 42 while building 300 seeded values, rendering them in the en-US and de-DE forms, and adding 300 ambiguous strings. Parsing ran on the script's own deterministic logic alone: one en-US rule, comma as thousands separator and dot as decimal point, applied to all 900 strings, with correctness judged against the known true values used at construction. No commercial product was measured; no vendor parser was tested or compared, and no claim is made about how any real tool would score. The volumes are declared as constructed volumes. What the test establishes is the arithmetic of the collision itself: when the convention mismatches, the misread is total within the group and the factor is 1000.0, and those structural facts do not depend on whose parser applies the wrong rule.

Summary

One parsing rule, applied to 900 numeric strings, read its own convention perfectly, misread the opposing convention completely at a uniform ratio of 1000.0, and faced 300 strings, 33.33% of the file, that no rule can settle without provenance. Locale Collision is not fixed by a better parser. It is fixed by treating locale as data: captured at intake, carried with the file, and applied per source, so that a number is always read in the language it was written in.

Sources

Know someone who needs this? Share it.

Advertisement