convert to int(), wrap in try/except

This commit is contained in:
Thomas Steen Rasmussen 2016-05-30 18:18:31 +02:00
parent 6f61220363
commit da5b0f0f26

View file

@ -6,7 +6,10 @@ register = template.Library()
@register.filter @register.filter
def currency(value): def currency(value):
return "{0:.2f} DKK".format(value) try:
return "{0:.2f} DKK".format(int(value))
except ValueError:
return False
@register.filter() @register.filter()