Specifying the currency to use for input and display (sys.Currency)¶
sys.Currency,,i2 |
Code of active currency |
This variable is part of the Sculptor multicurrency system, which enables automatic currency conversion to take place. Assigning a currency’s code to sys.Currency selects it as the active currency, to be used for the input, display and printing of monetary values.
All monetary values are stored in the application’s main currency. However, when an active currency is selected at run time, this stored data is dynamically converted to the active currency for the purposes of input, display, printing and calculations. The stored data itself remains entirely unaffected.
The value assigned to sys.Currency is an integer currency code. The main application currency always has the currency code 1; the other codes and currencies to be included in the system are selected by the programmer, and maintained with their exchange rates in a standard Sculptor data dictionary (.d). When a value is assigned to sys.Currency, the exchange rate record for this currency is read automatically.
The exchange rate, rounding unit and name of the active currency are stored in the variables sys.CurrencyRate, sys.RoundingUnit, and sys.CurrencyName.