diff --git a/atst/filters.py b/atst/filters.py index 10e42379..83dd98fd 100644 --- a/atst/filters.py +++ b/atst/filters.py @@ -3,5 +3,14 @@ def iconSvg(name): return contents.read() +def dollars(value): + try: + numberValue = float(value) + except ValueError: + numberValue = 0 + return "${:,.0f}".format(numberValue) + + def register_filters(app): app.jinja_env.filters['iconSvg'] = iconSvg + app.jinja_env.filters['dollars'] = dollars diff --git a/templates/requests.html b/templates/requests.html index 53950e10..a22a884b 100644 --- a/templates/requests.html +++ b/templates/requests.html @@ -116,7 +116,7 @@