From e950977e05db31d52ecd78029a87a639c4426971 Mon Sep 17 00:00:00 2001 From: Emi Vasilek Date: Mon, 6 Nov 2023 01:04:04 +0100 Subject: [PATCH] more readable amounts --- recipes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recipes.py b/recipes.py index 2d6f0a5..c037e30 100644 --- a/recipes.py +++ b/recipes.py @@ -281,7 +281,13 @@ class Builder: def numprint(input: int) -> str: out = str(input) if out.endswith(".0"): - return out.split(".")[0] + out = out.split(".")[0] + if out == "0.5": + return "1/2" + elif out == "0.25": + return "1/4" + elif out == "0.75": + return "3/4" return out self.jinjaenv.filters['numprint'] = numprint