1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

We store amounts in cents but users enter euros

This commit is contained in:
Yohann D'ANELLO
2020-03-21 18:59:13 +01:00
parent a220ca7549
commit 1c6d69ab9d
3 changed files with 45 additions and 6 deletions

View File

@ -18,5 +18,10 @@ def pretty_money(value):
)
def cents_to_euros(value):
return "{:.02f}".format(value / 100) if value else ""
register = template.Library()
register.filter('pretty_money', pretty_money)
register.filter('cents_to_euros', cents_to_euros)