Schemas
Money
Monetary values are encoded combining the currency and amount, using the smallest unit of currency to ensure accuracy and prevent floating-point issues.
MoneySchema Definition
The MoneySchema
includes:
- amount: Integer representing the value in the smallest currency unit (e.g., pence for GBP).
- currency: ISO 4217 currency code indicating the currency type.
Supported Currencies
Supports any currency with an ISO 4217 code.
Base Units for Currency
Transactions use the smallest currency unit to avoid rounding errors, e.g., 1050 in GBP represents £10.50.
A monetary value with currency.