MeridianMERIDIAN

Currency Code (ISO 4217)

finance.currency.currency_code

Three-letter currency code as defined by ISO 4217. Examples: USD, EUR, GBP, JPY. Used in financial data, trading systems, and international commerce.

Background

Origin

ISO 4217 is a standard published by the International Organization for Standardization that defines alpha codes and numeric codes for the representation of currencies.[1] ISO/TC 68 began developing a code for representing currencies in 1973.[1] The first edition of ISO 4217 was published in 1978.[1] Wikipedia gives ISO 4217:2015 as the most recent edition of the standard.[1]

For a national currency, the first two letters of the ISO 4217 alpha code are the country's ISO 3166-1 alpha-2 code and the third is usually the initial of the currency's main unit.[1] Japan's currency code is JPY, with JP for Japan and Y for yen.[1] Wikipedia notes that the country prefix removes the ambiguity of names such as dollar, franc, peso and pound being used in many countries.[1] The euro's code EUR is an exception, built on the code element EU that the ISO 3166 Maintenance Agency reserved for use within ISO 4217, with R appended to make a mnemonic.[1]

Gold, silver, palladium and platinum have the codes XAU, XAG, XPD and XPT, formed by prefixing the element's chemical symbol with X.[1] ISO 4217 reserves the code XTS for testing.[1] The code XXX denotes a transaction involving no currency.[1] ISO 4217 also assigns each currency a three-digit numeric code, such as 840 for USD.[1]

SIX is the official Maintenance Agency of the ISO 4217 currency codes, providing the service on behalf of ISO and its Swiss member SNV (Swiss Association for Standardization).[2] SIX says it continually updates the codes to reflect global economic and political changes.[2]

Use

The ISO 4217 code list is used in banking and business globally.[1] ISO 4217 alpha codes are used on airline tickets and international train tickets to remove any ambiguity about the price.[1] Java's java.util.Currency class identifies currencies by their ISO 4217 currency codes.[3] Stripe's documentation tells developers to use all lowercase letters when entering the three-letter ISO code in any payment request.[4] Fold a currency column to upper case before you match it against the code list. (Meridian's view)

Where you'll meet it

The European Central Bank's daily euro reference rates file labels each rate with a three-letter currency code, such as USD, JPY and GBP.[5]

Detection notes

v1 migration: Was finance.currency_iso_code. Three uppercase letters. First two letters usually match ISO 3166-1 country code (US→USD, GB→GBP), third letter is typically initial of currency name (D→Dollar, P→Pound).

Use it

CLI · DuckDB
$ finetype infer -i "USD" --mode column
→ finance.currency.currency_code

SELECT ft_infer('USD');
-- → 'finance.currency.currency_code'
Cast expression
UPPER(CAST({col} AS VARCHAR))

Schema

https://meridian.online/schemas/finance.currency.currency_code · Frictionless type string

finetype taxonomy finance.currency.currency_code -o json-schema

Aliases

iso_4217currency_iso

Type Registry