diff --git a/apps/note/templatetags/pretty_money.py b/apps/note/templatetags/pretty_money.py index 5b7acd12..ec0a0d5b 100644 --- a/apps/note/templatetags/pretty_money.py +++ b/apps/note/templatetags/pretty_money.py @@ -3,9 +3,9 @@ from django import template def pretty_money(value): if value%100 == 0: - return str(value//100) + '€' + return "{:s}{:d} €".format("- " if value < 0 else "", abs(value) // 100) else: - return str(value//100) + '€ ' + str(value%100) + return "{:s}{:d} € {:02d}".format("- " if value < 0 else "", abs(value) // 100, abs(value) % 100) register = template.Library() diff --git a/templates/base.html b/templates/base.html index 1761dad1..05328d0c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,4 +1,4 @@ -{% load static i18n static %} +{% load static i18n pretty_money static %} {% comment %} SPDX-License-Identifier: GPL-3.0-or-later {% endcomment %} @@ -62,7 +62,7 @@ SPDX-License-Identifier: GPL-3.0-or-later {% if user.is_authenticated %}