Type/to search
0
Follow
0
Followers
JSON ट्रांजेक्शन जोड़ी जानकारी को कैसे पार्स करें
FAQ
Created 2018-06-05 16:32:57  Updated 2019-07-31 17:33:32
 5
 2037

नीति पैरामीटर विन्यस्त व्यापार जोड़े के आधारभूत जानकारी निम्नानुसार है, कैसे js के साथ पार्स करने के लिए, कम से कम कुंजी और मान प्राप्त कर सकते हैं <unk>
{
"bigone":{
"BTC/USDT":{
"enable":0,
"amount_prec":5,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.01,
"mintrd":10,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":3,
"sell_fee_ratio":0.001
},
"EOS/BTC":{
"amount_prec":1,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":5,
"mintrd":0.001,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":8,
"sell_fee_ratio":0.001
},
"EOS/USDT":{
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":5,
"mintrd":10,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":3,
"sell_fee_ratio":0.001
},
"ETC/BTC":{
"amount_prec":2,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":4,
"mintrd":0.001,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":8,
"sell_fee_ratio":0.001
},
"ETH/BTC":{
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.1,
"mintrd":0.001,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":8,
"sell_fee_ratio":0.001
},
"ETH/EOS":{
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.1,
"mintrd":1,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":1,
"sell_fee_ratio":0.001
},
"ETH/USDT":{
"enable":0,
"amount_prec":4,
"buy_fee_ratio":0.001,
"delay_threshold":300,
"depth_ratio":0.2,
"maxtrd_amount":0.1,
"mintrd":10,
"mintrd_type":"quote",
"pause_rounds":5,
"price_prec":3,
"sell_fee_ratio":0.001
}
}
}

HTML में प्रयोग करने का प्रयास करें, लेकिन Inventor में मात्राएँ गलत हैं, कोई मान नहीं मिल रहा है.
कोड:
function main(){
Log(parameter);
for (var i in parameter) {
for (var j in parameter[i]) {
for (var k in parameter[i][k]) {
लॉग (k: " + k + " = = " + पैरामीटर[i][j][k]);
}
}
}
}
प्रिंट करने के लिएः

समय मंच प्रकार मूल्य मात्रा जानकारी
2018-06-04 00:00:00 जानकारी { "bigone":{ "BTC/USDT":{ "enable":0, "amount_prec":5,

Related Recommendations
Comment
All comments (5)
    function Iterator(dict, name){ if(typeof(dict) !== "object"){ Log(name, " : ", dict) return }else{ Log(name, "#FF0000") } for(var k in dict){ Iterator(dict[k], k) } } function main() { var jsonObj = { "bigone": { "BTC/USDT": { "enable": 0, "amount_prec": 5, "buy_fee_ratio": 0.001, "delay_threshold": 300, "depth_ratio": 0.2, "maxtrd_amount": 0.01, "mintrd": 10, "mintrd_type": "quote", "pause_rounds": 5, "price_prec": 3, "sell_fee_ratio": 0.001 }, "EOS/BTC": { "amount_prec": 1, "buy_fee_ratio": 0.001, "delay_threshold": 300, "depth_ratio": 0.2, "maxtrd_amount": 5, "mintrd": 0.001, "mintrd_type": "quote", "pause_rounds": 5, "price_prec": 8, "sell_fee_ratio": 0.001 }, "EOS/USDT": { "amount_prec": 4, "buy_fee_ratio": 0.001, "delay_threshold": 300, "depth_ratio": 0.2, "maxtrd_amount": 5, "mintrd": 10, "mintrd_type": "quote", "pause_rounds": 5, "price_prec": 3, "sell_fee_ratio": 0.001 }, "ETC/BTC": { "amount_prec": 2, "buy_fee_ratio": 0.001, "delay_threshold": 300, "depth_ratio": 0.2, "maxtrd_amount": 4, "mintrd": 0.001, "mintrd_type": "quote", "pause_rounds": 5, "price_prec": 8, "sell_fee_ratio": 0.001 }, "ETH/BTC": { "amount_prec": 4, "buy_fee_ratio": 0.001, "delay_threshold": 300, "depth_ratio": 0.2, "maxtrd_amount": 0.1, "mintrd": 0.001, "mintrd_type": "quote", "pause_rounds": 5, "price_prec": 8, "sell_fee_ratio": 0.001 }, "ETH/EOS": { "amount_prec": 4, "buy_fee_ratio": 0.001, "delay_threshold": 300, "depth_ratio": 0.2, "maxtrd_amount": 0.1, "mintrd": 1, "mintrd_type": "quote", "pause_rounds": 5, "price_prec": 1, "sell_fee_ratio": 0.001 }, "ETH/USDT": { "enable": 0, "amount_prec": 4, "buy_fee_ratio": 0.001, "delay_threshold": 300, "depth_ratio": 0.2, "maxtrd_amount": 0.1, "mintrd": 10, "mintrd_type": "quote", "pause_rounds": 5, "price_prec": 3, "sell_fee_ratio": 0.001 } } } Iterator(jsonObj) }

    img

    写了个简单的, 可能不完善,参考下。

    8 years ago

    JS 对于 JSON 对象 直接 可以用 for ... in... 遍历, 如果要获取 键值 , 直接用 键名 就可以获取。

    8 years ago

    @小小梦 我就是这样做的,拿到值不正确

    8 years ago

    看我刚才发的行不行。

    8 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)