-
Notifications
You must be signed in to change notification settings - Fork 2
GlobalUnit
Documentation > GlobalUnit
Global Units are units of account available by default in all Entities. There are thirty-six Global Units available to choose from, covering most major currencies.
Any Account or Transaction may be denominated in any Global Unit, and any Ledger, Balance or other derived object may be retrieved in any Global Unit. You can insert, store, and retrieve account information in heterogenous units and Amatino will seamlessly convert units for you.
Each Global Unit has a daily price in every other Global Unit. All prices are closing day prices per the European Central Bank.
If you require a higher temporal resolution than Global Units provide, or a Global Unit does not meet your requirements in some other way, you can create a Custom Unit with your required characteristics. Global Units and Custom Units can be intermingled at will, and Amatino will seamlessly convert between them as required.
.session - Session
The Session used to initialise this GlobalUnit
The integer identifier of this GlobalUnit, unique across Amatino
Example: 5
A short-hand string name for this GlobalUnit. Usually the underlying ISO 4217 currency code.
Example: 'USD'
A long-form string name for this GlobalUnit.
Example: 'U.S. Dollar'
An integer sorting priority, useful when presenting GlobalUnits in lists. Major traded global currencies have a higher sorting priority.
Example: 1
A long-form string description of this Global Unit
Example: United States Dollar
The integer number of base-10 digits required to store this CustomUnit's smallest fractional unit. For example, a U.S. Dollar has an exponent of 2, as its smallest fractional unit is one-hundredth - a cent.
Example: 2
Return a retrieved GlobalUnit
- session - Session
- id_ - int
usd = GlobalUnit.retrieve(
session=session,
id_=5
)