From 2bdb2c19efcb3c331a496c7afdd6997a01adc446 Mon Sep 17 00:00:00 2001 From: Yan Wittmann <2121578@stud.hs-mannheim.de> Date: Tue, 8 Nov 2022 11:45:35 +0100 Subject: [PATCH] Fixed toString method Signed-off-by: Skyball2000 --- aufgaben/src/Pflichtuebung_01/Date.elm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aufgaben/src/Pflichtuebung_01/Date.elm b/aufgaben/src/Pflichtuebung_01/Date.elm index 7f45347..fb8240f 100644 --- a/aufgaben/src/Pflichtuebung_01/Date.elm +++ b/aufgaben/src/Pflichtuebung_01/Date.elm @@ -40,8 +40,8 @@ gt date1 date2 = -- 1 Punkt: toString : Date -> String -toString (a,b,c) = (if a < 10 then "0" ++ String.fromInt(a) else String.fromInt(a)) - ++ (if b < 10 then "0" ++ String.fromInt(b) else String.fromInt(b)) +toString (a,b,c) = (if a < 10 then "0" ++ String.fromInt(a) else String.fromInt(a)) ++ "." + ++ (if b < 10 then "0" ++ String.fromInt(b) else String.fromInt(b)) ++ "." ++ (if c < 10 then "000" ++ String.fromInt(c) else if c < 100 then "00" ++ String.fromInt(c) else if c < 1000 then "0" ++ String.fromInt(c)