jon/jon/template_utils.py
Paul Brinkmeier afd7e9369d First draft of elm frontend
This will probably be scrapped or rewritten
2023-08-21 14:45:45 +02:00

20 lines
329 B
Python

import json
def format_currency(x):
# It would be nicer to format this using the German locale
# Too lazy to bother tho.
return f"{x:.02f}".replace(".", ",")
def format_date(d):
return d.strftime("%Y-%m-%d")
def format_bool(x):
return "" if x else ""
def to_json(x):
return json.dumps(x)