Currency Amount (Swiss Apostrophe)
finance.currency.amount_apostropheSwiss/Liechtenstein format using apostrophe for thousands separator and period for decimal. Supports both straight apostrophe (U+0027) and right single quotation mark (U+2019).
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As VARCHAR | numeric_value | symbol |
|---|---|---|---|
| CHF 1'234.56 | 1234.56 | 1234.56 | CHF |
| 1'234.56 CHF | 1234.56 | 1234.56 | CHF |
| CHF 10'000.00 | 10000.00 | 10000.00 | CHF |
| -CHF 999.99 | -999.99 | -999.99 | CHF |
Shape
^(CHF\s?)?-?[0-9]{1,3}(['\x{2019}][0-9]{3})*(\.[0-9]{1,2})?(\s?CHF)?$| Value | Length | Shape |
|---|---|---|
| CHF 1'234.56 | 12 | not checked |
| 1'234.56 CHF | 12 | not checked |
| CHF 10'000.00 | 13 | not checked |
| -CHF 999.99 | 11 | not checked |
pattern uses syntax this checker does not support
Background
Origin
Wikipedia's article on decimal separators says that in Switzerland currency values use an apostrophe as the thousands separator along with a dot as the decimal separator, like 1'234'567.89.[1] Wikipedia's table of examples lists 1'234'567.89 for Switzerland (computing) and Liechtenstein.[1] Wikipedia's article on the apostrophe says that in Switzerland the apostrophe is used as a thousands separator alongside the fixed space in all four national languages.[2]
The Swiss Federal Chancellery's Schreibweisungen, its rules for German-language official federal texts, appeared in a second, updated edition in 2013.[3] The Schreibweisungen require a decimal point instead of a decimal comma between the currency unit and its subunit in money amounts, as in Fr. 23.50.[3] The Schreibweisungen say the formerly customary grouping with an apostrophe should no longer be used, because it has to be undone for printing.[3] Read the apostrophe form as an everyday and software convention for Swiss amounts rather than the house style of official federal prose. (Meridian's view)
Use
The Unicode code chart for General Punctuation notes that U+2019 RIGHT SINGLE QUOTATION MARK is the preferred character to use for apostrophe.[4] The GNU C Library's de_CH locale sets both its numeric and its monetary thousands separator to the curly right single quotation mark ’.[5] The GNU C Library's de_CH locale gives CHF as its currency symbol and a full stop as its monetary decimal point.[5] CLDR 48.2, released on 2026-03-17, updated the group separator for number formatting to ' in fr-CH, consistent with other Swiss locales.[6]
Wikipedia's article on decimal separators says the apostrophe is also the most common thousands separator for Swiss non-currency values, like 1'234'567,89.[1] An apostrophe in the digits does not settle the decimal mark, so check whether a file ends its numbers with a full stop or a comma before you parse it. (Meridian's view) The Schreibweisungen write a dash in place of the two zeros after the decimal point, as in Fr. 20.–, and in place of the single zero before it, as in Fr. –.15.[3] When cleaning Swiss amounts, strip the currency code and both apostrophe characters, look out for dashes standing in for zeros, and only then cast to a decimal, keeping two decimal places for francs and centimes. (Meridian's view)
Sources
- [1]Decimal separatorsecondary source
- [2]Apostrophesecondary source
- [3]Schreibweisungen: Weisungen der Bundeskanzlei zur Schreibung und zu Formulierungen in den deutschsprachigen amtlichen Texten des Bundesstandard
- [4]General Punctuationstandard
- [5]sourceware.org Git - glibc.git/blob - localedata/locales/de_CHdocumentation
- [6]CLDR 48 Release Notedocumentation
Detection notes
New in format coverage expansion. Must handle both U+0027 (apostrophe) and U+2019 (right single quotation mark) as thousands separator.
Use it
$ finetype infer -i "CHF 1'234.56" --mode column
→ finance.currency.amount_apostrophe
SELECT ft_infer('CHF 1'234.56');
-- → 'finance.currency.amount_apostrophe'CAST(REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE({col}, 'CHF\s?', ''), '[''\x{2019}]', '', 'g'), '\s+', '', 'g') AS DECIMAL(18,2))Schema
https://meridian.online/schemas/finance.currency.amount_apostrophe · Frictionless type string
finetype taxonomy finance.currency.amount_apostrophe -o json-schema