mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 09:38:35 +02:00
feat: implement django-cotton
This commit is contained in:
@@ -16,26 +16,6 @@ def _format_string(prefix, amount, decimal_places, suffix):
|
||||
return f"{prefix}{formatted_amount}{suffix}"
|
||||
|
||||
|
||||
@register.simple_tag(name="transaction_amount")
|
||||
def transaction_currency(transaction: Transaction):
|
||||
prefix = transaction.account.currency.prefix
|
||||
amount = transaction.amount
|
||||
decimal_places = transaction.account.currency.decimal_places
|
||||
suffix = transaction.account.currency.suffix
|
||||
|
||||
return _format_string(prefix, amount, decimal_places, suffix)
|
||||
|
||||
|
||||
@register.simple_tag(name="entry_amount")
|
||||
def entry_currency(entry):
|
||||
prefix = entry["prefix"]
|
||||
amount = entry["amount"]
|
||||
decimal_places = entry["decimal_places"]
|
||||
suffix = entry["suffix"]
|
||||
|
||||
return _format_string(prefix, amount, decimal_places, suffix)
|
||||
|
||||
|
||||
@register.simple_tag(name="currency_display")
|
||||
def currency_display(amount, prefix, suffix, decimal_places):
|
||||
return _format_string(prefix, amount, decimal_places, suffix)
|
||||
|
||||
Reference in New Issue
Block a user