BinanceCNY

显示法定币价

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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);
})();