Meridianmeridian

Currency Amount (Space-Separated Thousands)

finance.currency.amount_space_sep

European variant using thin space or regular space for thousands grouping, comma for decimal, symbol as suffix. French, Polish, Czech formatting convention. Watch for NBSP (U+00A0).

Domain
finance
Category
currency
Casts to
VARCHAR
Scope
Universal

Try it

CLI
$ finetype infer -i "1 234,56 €"
→ finance.currency.amount_space_sep

DuckDB

Detect
SELECT finetype('1 234,56 €');
-- → 'finance.currency.amount_space_sep'
Cast expression
CAST(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE({col}, '[€$£¥₹₩₿\p{Sc}]', '', 'g'), '[\s\x{00A0}]+', '', 'g'), ',', '.'), '\.$', '') AS DECIMAL(18,2))
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS VARCHAR) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'finance.currency.amount_space_sep';

Struct Expansion

Expression
numeric_value: CAST(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE({col}, '[€$£¥₹₩₿\p{Sc}]', '', 'g'), '[\s\x{00A0}]+', '', 'g'), ',', '.'), '\.$', '') AS DECIMAL(18,2))
symbol: REGEXP_EXTRACT({col}, '([€$£¥₹₩₿\p{Sc}]+)')

JSON Schema

finetype schema finance.currency.amount_space_sep
{
  "$id": "https://meridian.online/schemas/finance.currency.amount_space_sep",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "European variant using thin space or regular space for thousands grouping, comma for decimal, symbol as suffix. French, Polish, Czech formatting convention. Watch for NBSP (U+00A0).",
  "examples": [
    "1 234,56 €",
    "999,99 €",
    "-1 234,56 €",
    "10 000,00 €"
  ],
  "pattern": "^-?[0-9]{1,3}([\\s\\x{00A0}][0-9]{3})*(,[0-9]{1,2})?\\s?[€$£¥₹₩₿\\p{Sc}]?$",
  "title": "Currency Amount (Space-Separated Thousands)",
  "type": "string",
  "x-finetype-broad-type": "VARCHAR",
  "x-finetype-transform": "CAST(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE({col}, '[€$£¥₹₩₿\\p{Sc}]', '', 'g'), '[\\s\\x{00A0}]+', '', 'g'), ',', '.'), '\\.$', '') AS DECIMAL(18,2))"
}

Examples

1 234,56 €999,99 €-1 234,56 €10 000,00 €

Aliases

fr_amount