retab? maybe

This commit is contained in:
Nils Schweinsberg 2017-10-15 03:42:18 +02:00
parent 023ac72be6
commit a0575a4826

View File

@ -13,12 +13,12 @@ class Coins(Plugin):
@staticmethod @staticmethod
def __currency(name, prefix=None, suffix=None): def __currency(name, prefix=None, suffix=None):
def tostr(value): def tostr(value):
return '{prefix}{value:,.2f}{suffix}'.format( return '{prefix}{value:,.2f}{suffix}'.format(
prefix=prefix or '', prefix=prefix or '',
suffix=suffix or ('' if (prefix or suffix) else (' ' + name)), suffix=suffix or ('' if (prefix or suffix) else (' ' + name)),
value=value) value=value)
return tostr return tostr
CURRENCIES = { CURRENCIES = {
'usd': __currency('usd', prefix='$'), 'usd': __currency('usd', prefix='$'),
@ -35,7 +35,7 @@ class Coins(Plugin):
%%btc [<currency>] %%btc [<currency>]
""" """
return self.cryptowat_summary('btc', 'coinbase', args) return self.cryptowat_summary('btc', 'coinbase', args)
@command @command
def eth(self, mask: IrcString, target: IrcString, args: Dict): def eth(self, mask: IrcString, target: IrcString, args: Dict):
"""Gets the Ethereum values from cryptowatch. """Gets the Ethereum values from cryptowatch.
@ -43,7 +43,7 @@ class Coins(Plugin):
%%eth [<currency>] %%eth [<currency>]
""" """
return self.cryptowat_summary('eth', 'coinbase', args) return self.cryptowat_summary('eth', 'coinbase', args)
@command @command
def xmr(self, mask: IrcString, target: IrcString, args: Dict): def xmr(self, mask: IrcString, target: IrcString, args: Dict):
"""Gets the Monero values from cryptowatch. """Gets the Monero values from cryptowatch.