commacommacommacommacommacommacomma

This commit is contained in:
Luke Rogers 2013-11-29 16:18:18 +13:00
parent d78f96b3ec
commit 2d5208cbde

View file

@ -14,11 +14,11 @@ def bitcoin(inp):
}, },
"bitpay": { "bitpay": {
"api_url": "https://bitpay.com/api/rates", "api_url": "https://bitpay.com/api/rates",
"func": lambda data: u"Bitpay // Current: \x0307${:.2f}\x0f".format(data[0]['rate']) "func": lambda data: u"Bitpay // Current: \x0307${:,.2f}\x0f".format(data[0]['rate'])
}, },
"bitstamp": { "bitstamp": {
"api_url": "https://www.bitstamp.net/api/ticker/", "api_url": "https://www.bitstamp.net/api/ticker/",
"func": lambda data: u"BitStamp // Current: \x0307${}\x0f - High: \x0307${}\x0f - Low: \x0307${}\x0f - Volume: {:.2f} BTC".format(data['last'], data['high'], data['low'], \ "func": lambda data: u"BitStamp // Current: \x0307${:,.2f}\x0f - High: \x0307${:,.2f}\x0f - Low: \x0307${:,.2f}\x0f - Volume: {:,.2f} BTC".format(float(data['last']), float(data['high']), float(data['low']), \
float(data['volume'])) float(data['volume']))
} }
} }
@ -43,5 +43,5 @@ def litecoin(inp, message=None):
"""litecoin -- gets current exchange rate for litecoins from BTC-E""" """litecoin -- gets current exchange rate for litecoins from BTC-E"""
data = http.get_json("https://btc-e.com/api/2/ltc_usd/ticker") data = http.get_json("https://btc-e.com/api/2/ltc_usd/ticker")
ticker = data['ticker'] ticker = data['ticker']
message("Current: \x0307${:.2f}\x0f - High: \x0307${:.2f}\x0f" message("Current: \x0307${:,.2f}\x0f - High: \x0307${:,.2f}\x0f"
" - Low: \x0307${:.2f}\x0f - Volume: {:.2f}LTC".format(ticker['buy'], ticker['high'], ticker['low'], ticker['vol_cur'])) " - Low: \x0307${:,.2f}\x0f - Volume: {:,.2f} LTC".format(ticker['buy'], ticker['high'], ticker['low'], ticker['vol_cur']))