currency
14 currency types: 4 a sibling also accepts, 1 of which it would misread, 12 that decompose into parts.
The 14 currency types
Each type's first registry sample, against every sibling's rule
| Type | Sample | Also accepted by |
|---|---|---|
Currency Amount (US Format) amount · DECIMAL | $1,234.56 | amount_accounting |
Currency Amount (US Accounting) amount_accounting · VARCHAR | $1,234.56 | amount |
Currency Amount (EU Suffix) amount_comma_suffix · VARCHAR | 1.234,56 € | amount_comma |
Currency Amount (Zero-Decimal Currency) amount_nodecimal · VARCHAR | ¥1,234 | amount → 1234.00 |
Currency Amount (Swiss Apostrophe) amount_apostrophe · VARCHAR | CHF 1'234.56 | — |
Currency Amount (ISO Code Prefix) amount_code_prefix · VARCHAR | USD 1,234.56 | — |
Currency Amount (EU Format) amount_comma · DECIMAL | €1.234,56 | — |
Currency Amount (Cryptocurrency) amount_crypto · VARCHAR | 0.00123456 BTC | — |
Currency Amount (Indian Lakh/Crore) amount_lakh · VARCHAR | ₹12,34,567.89 | — |
Currency Amount (Multi-Character Symbol) amount_multisym · VARCHAR | R$ 1.234,56 | — |
Currency Amount (Trailing Negative) amount_neg_trailing · VARCHAR | $1,234.56- | — |
Currency Amount (Space-Separated Thousands) amount_space · VARCHAR | 1 234,56 € | — |
Currency Code (ISO 4217) currency_code · VARCHAR | USD | — |
Currency Symbol currency_symbol · VARCHAR | $ | — |
Which currency type is it?
2 of 14 currency types accept it, and read it alike.
Currency Code (ISO 4217) carries no pattern or format, so it has no rule to ask.
| Type | Reads it as |
|---|---|
Currency Amount (US Format) amount | 1234.56 |
Currency Amount (US Accounting) amount_accounting | 1234.56 |
Use it
CLI · DuckDB
$ printf '%s\n' '$1,234.56' '-$999.99' > column.txt
$ finetype infer -f column.txt --mode column
SELECT ft_profile(v) FROM (VALUES ('$1,234.56'), ('-$999.99')) t(v);After -$999.99, one type remains: amount.