I sometimes like to have the words minutes and seconds spelled correctly in the timer. Here is a working suggestions for plural forms (basic but working).
if string.match(text, "%%fm") then
local minutes = math.floor(ms / 60000) % 60
if minutes < 1 then
minutes = string.format("%d", minutes) .. " minute"
else
minutes = string.format("%d", minutes) .. " minutes"
end
text = string.gsub(text, "%%fm", minutes)
end
if string.match(text, "%%fs") then
local seconds = math.floor(ms / 1000) % 60
if seconds < 1 then
seconds = string.format("%d", seconds) .. " second"
else
seconds = string.format("%d", seconds) .. " seconds"
end
text = string.gsub(text, "%%fs", seconds)
end
I sometimes like to have the words minutes and seconds spelled correctly in the timer. Here is a working suggestions for plural forms (basic but working).