﻿# CSV numeric locales: separate decimal parsing from field delimiting

CSV numeric locales: separate decimal parsing from field delimiting. A practical data-quality guide with failure mechanisms, validation steps, acceptance evidence and primary references.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/dq-csv-decimal-separator-ambiguity/
Language: en

A supplier exports decimal commas while another exporter uses commas between columns. A permissive importer produces a rectangular table but shifts numeric values or interprets them as text.

## The mechanism that changes the example

Delimiter recognition and numeric conversion are separate contracts. Automatic type inference can hide a locale mismatch when only some files contain fractional values or quoted fields.



## Define the comparison boundary

Specify the CSV dialect before configuring numeric conversion. Quote handling decides whether a decimal separator remains inside a single field; a numeric parser cannot reliably reconstruct columns after a delimiter error has already changed row structure.

Use source-qualified conversion settings for decimal marks and supported thousands formatting. The same visible numeric string can denote different magnitudes under different conventions. A language or country guess is weaker evidence than the exporter contract used for this file.

Retain selected raw field strings beside expected typed values in the fixture. Include an integer-only control because an incorrect decimal policy may remain invisible until fractional values arrive. Review parsed type and magnitude together; a column that quietly becomes text is a different failure from a correctly typed but incorrectly interpreted measurement.

## A constructed test case

Mix an explicitly quoted decimal-comma value with a separate integer field. Verify the intended column boundaries before converting the numeric text. A reader that merely reports a consistent row width has not completed this check.

## A reproducible validation procedure

Build fixtures containing quoted decimals, thousands separators and empty numeric cells. Pin parsing settings per source, compare parsed column counts and validate selected source strings against the expected numeric values.

Include an unchanged control and a deliberately invalid case. Verify that the checker distinguishes them before testing the complete release.

Exercise the actual preparation path, including later serialization and reload. Limit retained diagnostic content to the evidence required for this comparison.

## Evidence needed for acceptance

Retain the exporter dialect and a source-string to typed-value audit for each numeric feature.

## Containment and recovery

A valid CSV grammar does not establish that a parsed number has the correct unit or business meaning.

Quarantine an invalid release candidate or use an explicit partial-release rule. Preserve the last approved artifact and record corrections without silently rewriting historical inputs.

## Interpretation and references

Implementation references: [Arrow CSV conversion](https://arrow.apache.org/docs/python/csv.html); [Python decimal arithmetic](https://docs.python.org/3/library/decimal.html).

This is a proposed engineering validation, not an executed Retrivium benchmark. Documentation specifies interfaces; dataset acceptance needs its own evidence and must be repeated after relevant dependency changes.

## Related reading

Continue with [Frictionless Table Schema: validate logical values before feature building](/journal/data-guide-frictionless-table-schema/); [Apache Arrow: nulls, empty lists and nested training features](/journal/data-guide-arrow-nullable-feature-contract/). These guides supply adjacent context; the decision in this article remains the specific example-preservation check above.
