mirror of https://git.sr.ht/~sircmpwn/fosspay
parent
14d819cd88
commit
ee022f032d
@ -0,0 +1,21 @@ |
||||
from fosspay.config import _cfg |
||||
|
||||
class Currency: |
||||
def __init__(self, symbol, position): |
||||
self.symbol = symbol |
||||
self.position = position |
||||
|
||||
def amount(self, amount): |
||||
if self.position == "right": |
||||
return amount + self.symbol |
||||
else: |
||||
return self.symbol + amount |
||||
|
||||
currencies = { |
||||
'usd' : Currency("$", "left"), |
||||
'eur' : Currency("€", "right") |
||||
# ... More currencies can be added here |
||||
} |
||||
|
||||
currency = currencies[_cfg("currency")] |
||||
|
Loading…
Reference in new issue