retab? maybe
This commit is contained in:
parent
023ac72be6
commit
a0575a4826
12
bot/coins.py
12
bot/coins.py
@ -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='$'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user