convert to int(), wrap in try/except
This commit is contained in:
parent
6f61220363
commit
da5b0f0f26
|
@ -6,7 +6,10 @@ register = template.Library()
|
|||
|
||||
@register.filter
|
||||
def currency(value):
|
||||
return "{0:.2f} DKK".format(value)
|
||||
try:
|
||||
return "{0:.2f} DKK".format(int(value))
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
@register.filter()
|
||||
|
|
Loading…
Reference in a new issue