Bitrix Site Manager

CCurrencyLang::Update

bool
CCurrencyLang::Update(
 string currency, 
 string lang, 
 array arFields
);

The method Update modifies the language dependent parameters of the specified currency for the specified language.

Parameters

ParameterDescription
currency Identifier of currency whose language dependent parameters are to be updated.
lang The ID of language for which the language dependent parameters of a currency are to be updated.
arFields Associated array of new parameters of the currency whose keys are the parameter names and values are the parameter values.

The following keys are possible:
  • CURRENCY - the currency identifier;
  • LID - the language ID;
  • FORMAT_STRING - format string according to which the amounts in this currency are displayed in this language;
  • FULL_NAME - the currency full name;
  • DEC_POINT - symbol used as a 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.

Return Values

Returns true on success, or false otherwise.

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);
?>