Currency Amount (EU Suffix)
finance.currency.amount_comma_suffixEuropean format with currency symbol as suffix. Period for thousands, comma for decimal, symbol after amount with optional space. CLDR default for Germany, France, Spain, Italy, Netherlands.
Operations on this type: Parse nested values
Try a value
Currency Amount (EU Suffix)'s rule accepts it.
Reads it as 1234.56
Also accepted by
- Currency Amount (EU Format)
1234.56
Use it
finetype infer -i '1.234,56 €' --mode column
# → finance.currency.amount_comma_suffixSELECT ft_infer('1.234,56 €');
-- → 'finance.currency.amount_comma_suffix'CAST(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE({col}, '[€$£¥₹₩₿\p{Sc}]', '', 'g'), '\s+', '', 'g'), '\.', '', 'g'), ',', '.') AS DECIMAL(18,2))How finetype reads the samples
DuckDB 1.5.5 · finetype 0.6.66
| Value | As VARCHAR | numeric_value | symbol |
|---|---|---|---|
| 1.234,56 € | 1234.56 | 1234.56 | € |
| 999,99 € | 999.99 | 999.99 | € |
| -1.234,56 € | -1234.56 | -1234.56 | € |
| 0,50 € | 0.50 | 0.50 | € |
| 10.000,00 € | 10000.00 | 10000.00 | € |
Pattern
^-?[0-9]{1,3}(\.[0-9]{3})*(,[0-9]{1,2})?\s?[€$£¥₹₩₿\p{Sc}]$| Value | Length | Shape |
|---|---|---|
| 1.234,56 € | 10 | not checked |
| 999,99 € | 8 | not checked |
| -1.234,56 € | 11 | not checked |
| 0,50 € | 6 | not checked |
| 10.000,00 € | 11 | not checked |
pattern uses syntax this checker does not support
Background
Origin
FineType defines amount_comma_suffix itself, as a European currency format with the currency symbol after the amount, a period for thousands and a comma for the decimal.[1] FineType keeps amount_comma_suffix distinct from its amount_comma type, which also allows the symbol before the amount.[1]
CLDR's German locale data gives a comma as the decimal symbol and a full stop as the grouping symbol.[2] In LDML number patterns, the thousands separator and decimal separator are always written as ASCII ',' and '.', and are substituted with the locale's own values.[3] In LDML number patterns, the ¤ character is replaced by the localised currency symbol for the currency being formatted.[3]
Depending on the convention in each nation, the euro sign can either precede or follow the value.[4] Countries have generally continued the style they used for their former currencies when placing the euro sign.[4] In English the euro sign is usually placed before the figure, unspaced, which is the reverse of usage in many other European languages.[4]
Use
Python's Babel library documents format_currency(1099.98, 'EUR', locale='de_DE') as returning 1.099,98 followed by \xa0 and the euro sign.[5] Babel's parse_decimal reads '1.099,98' as Decimal('1099.98') under the de locale.[5]
Wikipedia's table of digit-grouping conventions lists the form 1.234.567,89 for countries including Austria, Germany, Italy and the Netherlands.[6] Treat a full stop as a thousands separator only once you are sure the whole column follows this convention; a value such as 1.234 on its own does not say which reading is meant. (Meridian's view) Split the symbol into its own column before casting, since a column in this shape can mix currencies and the symbol is the only thing that says which one each row is in. (Meridian's view)
Sources
- [1]finetype/labels/definitions_finance.yaml at main · meridian-online/finetype · GitHubFineType
- [2]cldr-json/cldr-json/cldr-numbers-full/main/de/numbers.json at main · unicode-org/cldr-json · GitHubstandard
- [3]Unicode Locale Data Markup Language (LDML) Part 3: Numbersstandard
- [4]Euro signsecondary source
- [5]Numbers and Currenciesdocumentation
- [6]Decimal separatorsecondary source
How it's detected
CLDR default for most eurozone countries. Distinct from amount_comma which allows prefix symbols.
Schema
https://meridian.online/schemas/finance.currency.amount_comma_suffix · Frictionless type string
finetype taxonomy finance.currency.amount_comma_suffix -o json-schema