# Decimal Number (Comma Separator)

Key: `representation.numeric.decimal_number_comma`

Number with comma as decimal separator and period as thousands separator (e.g., 1.234,56, 999,99, -42,5). The inverse of US format where period is decimal and comma is thousands. Silent corruption risk: "1.234" is either 1234 (comma-decimal thousands) or 1.234 (US decimal). Transforms to DOUBLE after swapping separators.

Page: <https://meridian.online/docs/finetype/types/representation/numeric/decimal_number_comma>

Samples: `1.234,56`, `999,99`, `1.000.000,00`, `-42,5`, `0,75`, `12.345,678`, `100,00`, `-1.234,00`

## Use it

Shell

```shell
finetype infer -i '1.234,56' --mode column
# → representation.numeric.decimal_number_comma
```

DuckDB

```sql
SELECT ft_infer('1.234,56');
-- → 'representation.numeric.decimal_number_comma'
```

Cast template: {col} is your column

```sql
CAST(REPLACE(REPLACE({col}, '.', ''), ',', '.') AS DOUBLE)
```

## Background

### Origin

Tables of logarithms prepared by John Napier in 1614 and 1619 used the period as the decimal separator.[[1]](https://en.wikipedia.org/wiki/Decimal_separator) Italy is among the countries that chose the comma to mark the decimal position.[[1]](https://en.wikipedia.org/wiki/Decimal_separator) English-speaking countries took the comma to separate groups of three digits instead.[[1]](https://en.wikipedia.org/wiki/Decimal_separator)

CGPM Resolution 10 says numbers may be divided into groups of three to make them easier to read.[[2]](https://www.bipm.org/en/committees/cg/cgpm/22-2003/resolution-10) CGPM Resolution 10 also says that neither dots nor commas are ever inserted in the spaces between groups.[[2]](https://www.bipm.org/en/committees/cg/cgpm/22-2003/resolution-10)

Unicode's CLDR data for the German locale gives a comma as the decimal symbol.[[3]](https://raw.githubusercontent.com/unicode-org/cldr-json/main/cldr-json/cldr-numbers-full/main/de/numbers.json) Unicode's CLDR data for the German locale gives a period as the grouping symbol.[[3]](https://raw.githubusercontent.com/unicode-org/cldr-json/main/cldr-json/cldr-numbers-full/main/de/numbers.json)

### Use

By default, Microsoft Excel uses the system separators defined in the regional settings in Control Panel.[[4]](https://support.microsoft.com/en-us/office/change-the-character-used-to-separate-thousands-or-decimals-c093b545-71cb-4903-b205-aebb9837bd1e) When a CSV file arrives with comma decimals, it is worth asking which regional settings the machine that exported it was using. (Meridian's view)

The pandas documentation suggests passing a comma as the decimal parameter for European data.[[5]](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html) DuckDB's CSV reader has a decimal\_separator option whose default is a period.[[6]](https://duckdb.org/docs/current/data/csv/overview.html) DuckDB's CSV reader has a thousands option, which must be a single character different from the decimal\_separator.[[6]](https://duckdb.org/docs/current/data/csv/overview.html) Python's locale.atof converts a string to a number following the LC\_NUMERIC settings.[[7]](https://docs.python.org/3/library/locale.html)

Decide the convention per column, not per value: 1.234 on its own could be one thousand two hundred and thirty-four or a little over one, and only its neighbours tell you which. (Meridian's view) Values with two separators, such as 1.234,56, settle the question, so look for them before trusting a column of short numbers. (Meridian's view) Strip the grouping periods before swapping the comma for a period, and never the other way round, or every value with a thousands group will be wrong. (Meridian's view) Keep the original text column until the converted totals have been checked against a known figure from the source. (Meridian's view)

### Where you'll meet it

The German Federal Statistical Office's notes on its short-term indicator CSV files say decimal places in the values are separated by a comma.[[8]](https://www.destatis.de/EN/Service/OpenData/Short-term-indicators/csv-notes.html?nn=350490)

## Sources

1. [Decimal separator](https://en.wikipedia.org/wiki/Decimal_separator) — secondary source
2. [Resolution 10 of the 22nd CGPM (2003)](https://www.bipm.org/en/committees/cg/cgpm/22-2003/resolution-10) — standard
3. [cldr-json/cldr-numbers-full/main/de/numbers.json](https://raw.githubusercontent.com/unicode-org/cldr-json/main/cldr-json/cldr-numbers-full/main/de/numbers.json) — standard
4. [Change the character used to separate thousands or decimals \| Microsoft Support](https://support.microsoft.com/en-us/office/change-the-character-used-to-separate-thousands-or-decimals-c093b545-71cb-4903-b205-aebb9837bd1e) — documentation
5. [pandas.read\_csv — pandas 3.0.6 documentation](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html) — documentation
6. [CSV Import](https://duckdb.org/docs/current/data/csv/overview.html) — documentation
7. [locale — Internationalization services](https://docs.python.org/3/library/locale.html) — documentation
8. [Notes on CSV files regarding short-term indicators - German Federal Statistical Office](https://www.destatis.de/EN/Service/OpenData/Short-term-indicators/csv-notes.html?nn=350490) — organisation

## How it's detected

European decimal format uses period for thousands and comma for decimal — the exact inverse of US format. Transform removes period thousands separators, replaces comma with period, then casts to DOUBLE. Column-level detection is important since single values like "1.234" are ambiguous between EU (=1234) and US (=1.234). The Sense model's locale awareness may help disambiguation.
