Documentation

GetByID

array
CCurrency::GetByID(
 string currency
);

The GetByID method returns an array of the language-independent parameters for a currency by its ID. Non-static method.

Method parameters

ParameterDescription
currency Currency ID.

Returned values

Associated array with the following keys.

Key Description
CURRENCY The three character currency code.
AMOUNT_CNT The number of currency units used by default to define the rate of exchange (for example, if CYP 10 equal to USD 21.58, 10 is the number of currency units).
AMOUNT The default rate of exchange. (One of currencies within a site must equal to 1. Such currency is called a base currency. Other currencies are defined relative to the base currency.)
SORT Sort order.
BASE (Y/N) flag species, if this currency is the base currency.
NUMCODE (Y/N) flag defines this currency as base currency.
CREATED_BY ID of the user, who added the currency.
MODIFIED_BY ID of the last user, who modified the currency.
DATE_UPDATE_FORMAT Date when the record was modified last, formatted in accordance with the site settings.

See also

CCurrency::GetCurrency

Example


<?
if (!($ar_usd_cur = CCurrency::GetByID("USD")))
{
    echo "The USD currency cannot be found";
}
else
{
    echo "The USD currency has the following parameters:<pre>";
    print_r($ar_usd_cur);
    echo "</pre>";
}
?>
© «Bitrix24», 2001-2024