When there are four words, these are used for the minutes

This commit is contained in:
ollo 2018-02-03 17:04:38 +01:00
parent ca47018a32
commit a4b085054e

View File

@ -220,14 +220,17 @@ function display_countcharacters_de(words)
end end
-- @fn display_countcharacters_de -- @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 -- @param words the same structure, as generated with the function @see display_timestat
-- @return the amount of words, used to describe the time or <code>0</code> on errors -- @return the amount of words, used to describe the time or <code>0</code> on errors
function display_countwords_de(words) function display_countwords_de(words)
local amount = 0 local amount = 0
for k,v in pairs(words) do for k,v in pairs(words) do
if (v ~= nil and v == 1) then 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 end
return amount return amount