I’m trying to find a way of displaying this in nightbot correctly.
https://api.binance.com/api/v1/ticker/price?symbol=BTCUSDT
It currently displays it like this: {“symbol”:“BTCUSDT”,“price”:“3547.61000000”}
Which is messy. Can this be formatted somehow?
Thanks!
@projectchaos
$(eval try{a=$(urlfetch json https://api.binance.com/api/v1/ticker/price?symbol=BTCUSDT);`BTC to USDT exchange rate: ${a.price}`;}catch(e){`Error!`;})
1 Like
That’s awesome! Thanks so much for the rapid reply. It works brilliantly! Is there anyway of removing all the 0000’s on the end of the price, or is that just what is outputted and cannot be changed?
This should remove trailing zeros:
$(eval try{a=$(urlfetch json https://api.binance.com/api/v1/ticker/price?symbol=BTCUSDT);`BTC to USDT exchange rate: ${parseFloat(a.price)}`;}catch(e){`Error!`;})
1 Like
That’s brilliant, just what I wanted. Many Thanks!
system
Closed
February 11, 2019, 12:54am
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.