From a4b085054e18e099a3dbe4584c5e9d414ac77551 Mon Sep 17 00:00:00 2001 From: ollo Date: Sat, 3 Feb 2018 17:04:38 +0100 Subject: [PATCH] When there are four words, these are used for the minutes --- wordclock.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wordclock.lua b/wordclock.lua index 10f5da8..3b5c021 100755 --- a/wordclock.lua +++ b/wordclock.lua @@ -220,15 +220,18 @@ function display_countcharacters_de(words) end -- @fn display_countcharacters_de --- Count the amount of words, used to describe the current time in words +-- Count the amount of words, used to describe the current time in words! +-- (min1 to min4 are ignored) -- @param words the same structure, as generated with the function @see display_timestat -- @return the amount of words, used to describe the time or 0 on errors function display_countwords_de(words) local amount = 0 for k,v in pairs(words) do if (v ~= nil and v == 1) then - amount = amount + 1 + if (k ~= "min1" and k ~= "min2" and k ~= "min3" and k ~= "min4") then + amount = amount + 1 + end end - end + end return amount end