Skip to content

Monetary Type

The monetary type stores a numeric amount with its currency, preventing accidental mixing of different currencies.

Diagram
DuckDB

          

Add or subtract values with the same currency:

DuckDB

          

Attempting to add different currencies raises an error:

DuckDB

          

Get the currency for a country:

DuckDB

          

Get countries using a currency:

DuckDB

          

The parser handles various formats:

DuckDB

          

Ambiguous symbols like $ require explicit currency codes:

DuckDB