00af109e2f
* add flake8 to pre-commit config, and fixup many things to make flake8 happy * add isort and sort all imports, add to pre-commit and requirements
14 lines
233 B
Python
14 lines
233 B
Python
from decimal import Decimal
|
|
|
|
from django import template
|
|
|
|
register = template.Library()
|
|
|
|
|
|
@register.filter
|
|
def currency(value):
|
|
try:
|
|
return "{0:.2f} DKK".format(Decimal(value))
|
|
except ValueError:
|
|
return False
|