Fixed util.getTimeFromString returning unnecessary floating point

This commit is contained in:
Timo Smit 2017-01-12 13:54:02 +01:00
parent a14f5f1b32
commit f0af3cfe03
1 changed files with 3 additions and 1 deletions

View File

@ -129,7 +129,9 @@ end
function util.getTimeFromString(str)
local amount, unit = string.match(str, "^([0-9]+)([smhdwy])$")
if not (amount and unit) then return false end
if not (amount and unit) then return nil end
amount = math.floor(amount)
local multiplier = {
["s"] = function(a) return a end,