The Central Bank of Russian Federation (2024)

')); var nexButton = $(''); if (firstDateExist.NextWeekExist != null) { nexButton.click(function () { LoadCursPanel(firstDateExist.NextWeekExist, valId); }); } header.append(nexButton); RootTbl.append(header); var table = $('

'); var has_first_day = true; $.each(data, function (index, k) { var tr = $('

'); var diff_color = ''; var diff_sign = ''; if (k.diff > 0) { diff_color = 'class="_red"'; diff_sign = '+'; } if (k.diff < 0) { diff_color = 'class="_green"'; } if (has_first_day & k.curs === null) { // пропускаем до первого курса (минуем понедельники) return; } has_first_day = false; tr.append($('

' + moment(k.data).format("ddd") + '

')); tr.append($('

' + moment(k.data).format("DD.MM") + '

')); tr.append($('

' + (k.curs === null ? ' — ' : number_format(k.curs, 4, ',', ' ') + '₽') + '

')); if (k.diff === null) { tr.append($('

')); } else { tr.append($('

' + diff_sign + number_format(k.diff, 4, ',', ' ') + '₽

')); } table.append(tr); }); RootTbl.append(table); RootTbl.append($('

' + (IsEng ? 'Bank of Russia official exchange rates' : 'Официальный курс Банка России') + '

')); }).fail(function (xhr, textStatus, errorThrown) { var RootTbl = $("#V_" + valId); RootTbl.empty(); var Err = xhr.statusText; RootTbl.append($("

" + (IsEng ? "Error: " + Err + ", try refresh the page" : "Ошибка: " + Err + ", попробуйте обновить страницу") + "

")); }); } function number_format(number, decimals, dec_point, separator) { number = (number + '').replace(/[^0-9+\-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof separator === 'undefined') ? ',' : separator, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function (n, prec) { var k = Math.pow(10, prec); return '' + (Math.round(n * k) / k) .toFixed(prec); }; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) .split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '') .length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1) .join('0'); } return s.join(dec); }});//]]

");}function AutoTabSelect() { $(".tab").click(function (e) { firstLoad = true; var tabid = $(this).data("tabs-tab"); $.cookie("SelectedTab", tabid, { expires: 1 }); }); if ($.cookie("SelectedTab") !== undefined) { var tabidSelect = $.cookie("SelectedTab"); var tabObj = $(".d-md-block * [data-tabs-tab='" + tabidSelect + "']"); if (tabObj.length !== 0) { tab_id = tabidSelect; //tabObj.trigger('open-tab'); tabObj.click(); //$(".tab").removeClass("_active"); //tabObj.addClass("_active"); return true; } } return false;}function LoadTab(reset) { var lang = $("meta[name='zoom:lang']").attr("content"); moment.locale(lang); pageCounter = 0; var loadPageText = 'Загрузить еще'; var IsEng = 0; if (lang === 'en') { loadPageText = 'Load more'; IsEng = 1; } var idiv = $("#events_tab" + tab_id); var vrap = idiv.parent(); if (vrap.children(".more-button").length > 0 && reset === false) return; idiv.empty(); if (reset) { News_last_day = null; } if (vrap.children(".more-button").length === 0) { var nexButton = $(''); // nexButton.hide(); vrap.append(nexButton); nexButton.click(function () { if (_PageLoadding) return; _PageLoadding = true; pageCounter++; if (tab_id === 7) { NLoadPage(idiv, pageCounter, IsEng); } else { EPLoadPage(idiv, pageCounter, IsEng, tab_id); } }); } if (tab_id === 7) { NLoadPage(idiv, 0, IsEng); } else { EPLoadPage(idiv, 0, IsEng, tab_id); } //vrap.prepend(idiv); }function EPLoadPage(idiv, page, IsEng, tab_id) { var more_button = idiv.parent().children(".more-button"); more_button.addClass("_loading"); $.ajax({ url: _EventSourceURL, data: { page: page, IsEng: (IsEng === 1), type: tab_id }, cache: false }).done(function (data) { _PageLoadding = false; more_button.removeClass("_loading"); if (data.length !== _PageSize) { more_button.hide(); } else { more_button.show(); } //var firstOrImportant = false; //var fo = data.filter(function (item) { // return (item.ImageId > 0 || item.ImageCId > 0); //}); //// вставляем важную новость или новость с картинкой //if (fo.length > 0 && page === 0) { // // превая строка // firstOrImportant = fo[0]; // idiv.append(MakeEventRow(fo[0], true)); // last_big = true; //} $.each(data, function (index, k) { //if (k === firstOrImportant) { // return null; //} //var MakeBig = k.BigPictureInMain; //if (last_big && MakeBig) { // last_big = false; // MakeBig = false; //}; idiv.append(MakeEventRow(k, (k.ImageId > 0 || k.ImageCId > 0) && (index == 0 && firstLoad))); firstLoad = false; //last_big = MakeBig; }); idiv.trigger('new-html'); }).fail(function (xhr, textStatus, errorThrown) { idiv.append(IsNetworkErrMsg(xhr.statusText)); _PageLoadding = false; });}function decodeType(name, IsEng) { var tpName = ''; switch (name) { case "events": tpName = IsEng ? 'News' : 'Новость'; break; case "performance": tpName = IsEng ? 'Speech' : 'Выступление'; break; case "interview": tpName = IsEng ? 'Interview' : 'Интервью'; break; case "press": tpName = IsEng ? 'Press release' : 'Пресс-релиз'; break; default: tpName = IsEng ? 'News' : 'Новость'; } return tpName;}function NLoadPage(idiv, page, IsEng, dateFrom, dateTo) { var more_button = idiv.parent().children(".more-button"); more_button.addClass("_loading"); $.ajax({ url: _NewsSourceURL, data: { page: page, IsEng: (IsEng === 1) }, cache: false }).done(function (data) { _PageLoadding = false; more_button.removeClass("_loading"); if (data.length !== _PageSize) { more_button.hide(); } else { more_button.show(); } //divday = $('

'); $.each(data, function (index, k) { if (News_last_day !== k.DT) { News_last_day = k.DT; divday = $('

'); dt = $('

' + moment(k.DT).format("DD MMMM YYYY") + '

'); divday.append(dt); idiv.append(divday); } var press_root = $('

'); var row = $('

'); row.append($('

' + k.dateupdate + '

')); var titleInfo = $('

' + k.name_doc.trim() + '

'); row.append(titleInfo); if (k.Important !== 0) { row.append($('

')); } press_root.append(row); if (k.MenuTitle !== null) { press_root.append($('

' + k.MenuTitle.trim() + '

')); } divday.append(press_root); }); divday.trigger('new-html'); }).fail(function (xhr, textStatus, errorThrown) { idiv.append(IsNetworkErrMsg(xhr.statusText)); _PageLoadding = false; });}function MakeEventRow(k, IsImportantRow) { var bgRoot = 'style="background-image:url(/legacy/PhotoStore/getimgid/'; var inv_image = k.width == 1090; var fext = ".jpg"; if (k.mimeType === 'image/png') { fext = ".png"; } var dtm = moment(k.DT).format("DD MMMM YYYY"); if (moment(k.DT).format("DD.MM.YYYY") === moment().format("DD.MM.YYYY")) { dtm = IsEng === 1 ? "Today" : "Сегодня"; } var tpName = decodeType(k.TBLType, IsEng); var _link = ''; if (k.TBLType === 'press') { _link = '/press/pr/?file=' + k.doc_htm; } else { _link = '/press/event/?id=' + k.doc_htm; } _link = (IsEng ? '/eng' + _link : _link); var press_root = $('

'); var bkgimg = ""; if (IsImportantRow) { bkgimg = bgRoot; if (inv_image) { if (k.ImageCId > 0) { bkgimg += k.ImageCId + fext + ');"'; } else { bkgimg += k.ImageId + '.jpg);"'; } } else { if (k.ImageId > 0) { bkgimg += k.ImageId + '.jpg);"'; } else { bkgimg += k.ImageCId + '.png);"'; } } } var news_inner = $('

'); var rtp = $('

'); rtp.append($('

' + dtm + '

' + tpName + '

')); rtp.append($('' + k.name_doc + '')); news_inner.append(rtp); if (!_NoPictInList || IsImportantRow) { var imgnode = ''); } else { if (k.ImageId > 0) { news_inner.append(imgnode + k.ImageId + '.jpg" alt="full image">'); } } } else { if (k.ImageId > 0) { news_inner.append(imgnode + k.ImageId + '.jpg" alt="full image (1)">'); } else { // елси есть кроп то еего if (k.ImageCId > 0) { news_inner.append(imgnode + k.ImageCId + '.png" alt="cropped image (1)">'); } } } } press_root.append(news_inner); return press_root;}//]]

News

AllNewsPress releases SpeechesWhat’snew

Inflation target

4.0%

Inflation

December 2023

7.4%

Key rate

from 18.12.2023

16.00%

RUONIA

25.01.2024

16.00%

Exchange rates

26.01.2024

27.01.2024

CNY,

12.3270 ₽

12.4375 ₽

Official exchange rates

USD,1$

88.6562 ₽

89.5159 ₽

Official exchange rates

EUR,1€

96.6365 ₽

97.0945 ₽

Official exchange rates

All indicators

Subscription

Site news and updates

Subscribe

Bank of Russia Publications

Publication Schedule

RSS Channels

As an expert in web development and programming languages, particularly JavaScript and jQuery, I'm well-versed in analyzing and understanding code snippets like the one provided. Let's break down the concepts and functions used in the provided code:

  1. JavaScript/jQuery Functions:

    • The code utilizes various JavaScript and jQuery functions like $(''), .append(), .format(), .click(), .empty(), .fail(), .ajax(), .done(), .trigger(), .hasClass(), .show(), .hide(), .parent(), .children(), .each(), $.cookie(), moment.locale(), moment(), parseInt(), Number(), typeof, among others.
    • These functions are used for DOM manipulation, event handling, AJAX requests, and cookie handling, among other tasks.
  2. Conditional Statements and Loops:

    • The code contains conditional statements (if, else if, else) and loops ($.each()).
    • These control the flow of execution based on certain conditions and iterate over data.
  3. Variable Manipulation:

    • Variables (var) are used to store data and manipulate it throughout the code.
    • Operations like string manipulation, mathematical calculations, and boolean operations are performed on variables.
  4. AJAX Requests:

    • AJAX requests are made to fetch data from a server asynchronously without reloading the entire page.
    • The .ajax() function is used to make these requests, and .done() and .fail() are used to handle the responses.
  5. Date and Time Handling:

    • The moment.js library is used for date and time manipulation.
    • Dates are formatted using moment() with specific formats like "ddd" and "DD.MM".
    • Date comparison and manipulation are done to control the display of certain data.
  6. Error Handling:

    • Error handling is implemented using .fail() to catch any errors that occur during AJAX requests.
    • Error messages are displayed to the user in case of failures.
  7. Number Formatting:

    • The number_format() function is defined for formatting numerical values with specific precision, decimal points, and separators.
  8. Language Localization:

    • The code supports localization (English and Russian) based on the language of the page (lang).

Overall, the code snippet provided appears to be part of a web application that fetches and displays data related to exchange rates, news, and events. It's written in JavaScript/jQuery and utilizes various libraries and functions for dynamic content generation and interaction with the server.

The Central Bank of Russian Federation (2024)
Top Articles
Latest Posts
Article information

Author: The Hon. Margery Christiansen

Last Updated:

Views: 6110

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: The Hon. Margery Christiansen

Birthday: 2000-07-07

Address: 5050 Breitenberg Knoll, New Robert, MI 45409

Phone: +2556892639372

Job: Investor Mining Engineer

Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.