From 65608d2a2349b7ba5ea9e0d0b35065fbeff6519c Mon Sep 17 00:00:00 2001 From: cybrwshl Date: Mon, 19 Feb 2024 22:33:35 +0100 Subject: [PATCH] fixes display of money amounts below 1eur --- rechnung.typ | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rechnung.typ b/rechnung.typ index 1e0cf80..0be0d38 100644 --- a/rechnung.typ +++ b/rechnung.typ @@ -66,7 +66,14 @@ if i == 0 { return "0.00€" } - str(calc.round(i * 100)).slice(0,-2)+ "." + str(calc.round(i * 100)).slice(-2) + "€" + + let j = str(calc.round(i * 100)) + + if i < 1 { + "0." + j.slice(-2) + "€" + } else { + j.slice(0,-2)+ "." + j.slice(-2) + "€" + } } // DIN 5008 nach Faltmarke 1