Monetary Type
The monetary type stores a numeric amount with its currency, preventing accidental mixing of different currencies.
Architecture
Section titled “Architecture”Basic Usage
Section titled “Basic Usage”DuckDB
Arithmetic
Section titled “Arithmetic”Add or subtract values with the same currency:
DuckDB
Attempting to add different currencies raises an error:
DuckDB
Currency Functions
Section titled “Currency Functions”Get the currency for a country:
DuckDB
Get countries using a currency:
DuckDB
Parsing
Section titled “Parsing”The parser handles various formats:
DuckDB
Ambiguous symbols like $ require explicit currency codes:
DuckDB