We store amounts in cents but users enter euros
This commit is contained in:
parent
a220ca7549
commit
1c6d69ab9d
3 changed files with 45 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue