Files
jon/jon/template_utils.py
T
paul be86248cce First draft of elm frontend
This will probably be scrapped or rewritten
2023-08-22 13:14:54 +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)