MeridianMERIDIAN

Decimal comma vs decimal point

The types

TypeFormPatternDuckDB transformSample
Decimal NumberDecimal point^-?[0-9]+(\.[0-9]+)?([eE][+-]?[0-9]+)?$CAST({col} AS DOUBLE)3.14
Decimal Number (Comma Separator)Decimal comma^-?[0-9]{1,3}(\.[0-9]{3})*(,[0-9]+)?$|^-?[0-9]+,[0-9]+$CAST(REPLACE(REPLACE({col}, '.', ''), ',', '.') AS DOUBLE)1.234,56

What the standards say

The 22nd General Conference on Weights and Measures declared in 2003 that the symbol for the decimal marker shall be either the point on the line or the comma on the line.[1][2] CGPM Resolution 10 says numbers may be divided into groups of three to make them easier to read.[1] CGPM Resolution 10 also says that neither dots nor commas are ever inserted in the spaces between groups.[1]

How finetype tells them apart

From finetype 0.6.66's source.

finetype's rule for decimal_number accepts an optional minus sign, digits, an optional point followed by digits and an optional exponent, and has no place for a comma.[3] Its rule for decimal_number_comma accepts an optional minus sign, then one to three digits followed by any number of groups of a point and three digits, then an optional comma and digits, or else an optional minus sign, digits, a comma and digits.[4] So a value such as 3,14 or 1.234,56 passes only the comma rule, a value such as 1.5 or 1234.56 passes only the point rule, and a value such as 1.234 or 12.345 passes both.[3][4] A number grouped by commas with a decimal point, such as 1,234.56, passes neither rule.[3][4]

decimal_number's transform casts the text to a DOUBLE as it stands, so it reads 1.234 as a little over one.[5] decimal_number_comma's transform removes every point and then replaces the comma with a point before the cast, so it reads 1.234 as one thousand two hundred and thirty-four.[6] finetype's registry calls this a silent corruption risk, and its notes say column-level detection matters because a single value such as 1.234 is ambiguous between the two.[7][8] For a column labelled either type, finetype's profile reports the share of its non-null sampled values that pass that type's rule, and treats fewer than half passing as the values contradicting the label.[9][10][11][12] When every value in a column passes both rules, the values cannot settle which form it uses, so the answer has to come from whoever wrote the file, its documentation or a total checked against a known figure. (Meridian's view)

What finetype's evaluation shows

The evaluation report in finetype's repository at release 0.6.66 measured release 0.6.60 on 2026-09-23.[13] The report says its tables are generated by a separate tool that has drifted from the SQL harness it claims to mirror, and that a figure taken from it for publication must be its SQL headline.[14] Until finetype publishes a measurement for each type, this page gives no figure for how often it mistakes one form for the other. (Meridian's view)

Who writes each form

Decimal point

Most computer languages and standard data formats, among them C, Java, Fortran and CSS, specify a dot as the decimal separator.[2] RFC 8259, the JSON specification, defines a number as an optional minus sign, an integer part, an optional fraction and an optional exponent.[15] The US Geological Survey's CSV feed of significant earthquakes writes latitude, longitude and magnitude as decimal numbers with a point as the separator.[16]

Decimal comma

Italy is among the countries that chose the comma to mark the decimal position.[2] Unicode's CLDR data for the German locale gives a comma as the decimal symbol.[17] Unicode's CLDR data for the German locale gives a period as the grouping symbol.[17] By default, Microsoft Excel uses the system separators defined in the regional settings in Control Panel.[18] 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.[19]

Type Registry