diff --git a/apps/note/templatetags/__init__.py b/apps/note/templatetags/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/note/templatetags/pretty_money.py b/apps/note/templatetags/pretty_money.py new file mode 100644 index 00000000..5b7acd12 --- /dev/null +++ b/apps/note/templatetags/pretty_money.py @@ -0,0 +1,12 @@ +from django import template + + +def pretty_money(value): + if value%100 == 0: + return str(value//100) + '€' + else: + return str(value//100) + '€ ' + str(value%100) + + +register = template.Library() +register.filter('pretty_money', pretty_money) diff --git a/templates/member/profile_detail.html b/templates/member/profile_detail.html index ea2f0f07..11f50f65 100644 --- a/templates/member/profile_detail.html +++ b/templates/member/profile_detail.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load i18n static %} +{% load i18n static pretty_money %} {% block content %}