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('"', '.')
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())}
def balance_euro(cls): return from_ap(self.balance)
def amount_euro(self): return from_ap(self.amount)
def price_euro(self): return from_ap(self.price)