array
CCurrencyLang::GetByID(
string currency,
string lang
);
The method GetByID returns an array of the language dependent
parameters of the specified currency for the specified language.
Parameters
Parameter | Description |
currency |
Identifier of currency whose language dependent parameters are required. |
lang |
The ID of the language for which the parameters are to be returned. |
Return Values
Associated array containing the following keys:
Key |
Description |
CURRENCY |
The three character currency code. |
LID |
The language ID. |
FORMAT_STRING |
Format string according to which the amounts in this currency are displayed
in LID. |
FULL_NAME |
Full name of the currency. |
DEC_POINT |
Symbol used as decimal point when displaying amounts. |
THOUSANDS_SEP |
Symbol used as thousands separator when displaying amounts. |
DECIMALS |
Number of digits in the fractional part of an amount when
displaying amounts. |
Example
<?
$arFields = array(
"FORMAT_STRING" => "# USD", // symbol # is replaced
// with the real amount when displaying
"FULL_NAME" => "Dollar",
"DEC_POINT" => ".",
"THOUSANDS_SEP" => "\xA0", // NBSP
"DECIMALS" => 2,
"CURRENCY" => "USD",
"LID" => "en"
);
// If the record exists, modify, or add a new one otherwise
$db_result_lang = CCurrencyLang::GetByID("USD", "en");
if ($db_result_lang)
CCurrencyLang::Update("USD", "en", $arFields);
else
CCurrencyLang::Add($arFields);
?>