Beispiel #1
0
def pretty_money(value, arg=',', currency='€'):
    value = from_ap(value)
    if value is None:
        return '-'

    if isinstance(value, int):
        return ('{:,.2f} {}'.format(value / 100.0,
                                    currency).replace(',', '"').replace(
                                        '.', arg).replace('"', '.'))
    elif isinstance(value, (Decimal, float)):
        return '{:,.2f} {}'.format(value, currency).replace(',', '"').replace(
            '.', arg).replace('"', '.')

    return '{:,.2f} {}'.format(value, currency).replace(',', '"').replace(
        '.', arg).replace('"', '.')
Beispiel #2
0
 def get_initial(self):
     pub_hash = self.kwargs.get('pub_hash')
     wallet = Wallet.for_pub_hash(pub_hash)
     return {'amount': from_ap(wallet.maximum_payout())}
Beispiel #3
0
 def balance_euro(cls):
     return from_ap(self.balance)
Beispiel #4
0
 def amount_euro(self):
     return from_ap(self.amount)
Beispiel #5
0
 def price_euro(self):
     return from_ap(self.price)