BinanceCNY

显示法定币价

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         BinanceCNY
// @namespace    https://www.binance.com/
// @version      0.3
// @description  显示法定币价
// @author       Shevckcccc
// @match        https://www.binance.com/trade.html?symbol=*
// ==/UserScript==

(function() {
    'use strict';
    setInterval(function(){
        var current_price = parseFloat($('.kline-para ul li strong').eq(0).text());
        var country_price = parseFloat($('.kline-para ul li strong').eq(1).text().replace(/[^0-9\.]/g, ''));
        var unit_price = country_price / current_price;

        var asks = $('#askScrollBox .askTable tr .f-left .ng-binding span');
        asks.each(function (index, item) {
            var origin_price = item.innerText.split('|')[0];
            var price = parseFloat(origin_price * unit_price).toFixed(2);
            $(item).text(origin_price + '|' + price);
        });

        var bids = $('#bidScrollBox .bidTable tr .f-left .ng-binding span');
        bids.each(function (index, item) {
            var origin_price = item.innerText.split('|')[0];
            var price = parseFloat(origin_price * unit_price).toFixed(2);
            $(item).text(origin_price + '|' + price);
        });
    }, 2000);
})();