Пример #1
0
 def render(self, context):
     amount = self.amount.resolve(context)
     currency = self.currency.resolve(context)
     return format_currency(amount, currency, precision=self.precision)
Пример #2
0
def currency(amount, currency="USD"):
    if not amount:
        return None
    return format_currency(amount, currency)