Meridianmeridian

Currency Amount (Zero-Decimal Currency)

finance.currency.amount_nodecimal

Currency amounts for zero-decimal currencies (JPY, KRW, VND, CLP, ISK, HUF, and ~15 others). No fractional part. Comma thousands grouping with symbol prefix or suffix. broad_type is INTEGER.

Domain
finance
Category
currency
Casts to
VARCHAR
Scope
Universal

Try it

CLI
$ finetype infer -i "¥1,234"
→ finance.currency.amount_nodecimal

DuckDB

Detect
SELECT finetype('¥1,234');
-- → 'finance.currency.amount_nodecimal'
Cast expression
CAST(REGEXP_REPLACE(REGEXP_REPLACE({col}, '[¥₩\p{Sc}]', '', 'g'), ',', '') AS INTEGER)
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_nodecimal';

Struct Expansion

Expression
numeric_value: CAST(REGEXP_REPLACE(REGEXP_REPLACE({col}, '[¥₩\p{Sc}]', '', 'g'), ',', '') AS INTEGER)
symbol: REGEXP_EXTRACT({col}, '([¥₩\p{Sc}])')

JSON Schema

finetype schema finance.currency.amount_nodecimal
{
  "$id": "https://meridian.online/schemas/finance.currency.amount_nodecimal",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Currency amounts for zero-decimal currencies (JPY, KRW, VND, CLP, ISK, HUF, and ~15 others). No fractional part. Comma thousands grouping with symbol prefix or suffix. broad_type is INTEGER.",
  "examples": [
    "¥1,234",
    "₩10,000",
    "¥100,000",
    "₩1,234,567"
  ],
  "pattern": "^[¥₩\\p{Sc}]?-?[0-9]{1,3}(,[0-9]{3})*[¥₩\\p{Sc}]?$",
  "title": "Currency Amount (Zero-Decimal Currency)",
  "type": "string",
  "x-finetype-broad-type": "VARCHAR",
  "x-finetype-transform": "CAST(REGEXP_REPLACE(REGEXP_REPLACE({col}, '[¥₩\\p{Sc}]', '', 'g'), ',', '') AS INTEGER)"
}

Examples

¥1,234₩10,000¥100,000₩1,234,567

Aliases

jpy_amountzero_decimal