diff --git a/exp_util/module/module_exports.lua b/exp_util/module/module_exports.lua index 4d0bb78a..616758d2 100644 --- a/exp_util/module/module_exports.lua +++ b/exp_util/module/module_exports.lua @@ -265,15 +265,14 @@ end --- @param units Common.format_time_param_units A table selecting which units should be displayed, options are: days, hours, minutes, seconds --- @return Common.extract_time_units_return function ExpUtil.extract_time_units(ticks, units) - ticks = ticks or 0 -- Calculate the values to be determine the display values local max_days, max_hours, max_minutes, max_seconds = ticks / 5184000, ticks / 216000, ticks / 3600, ticks / 60 local rtn = { - day = floor(max_days), - hours = floor(max_hours - floor(max_days) * 24), - minutes = floor(max_minutes - floor(max_hours) * 60), - seconds = floor(max_seconds - floor(max_minutes) * 60), + day = floor(max_days) or 0, + hours = floor(max_hours - floor(max_days) * 24) or 0, + minutes = floor(max_minutes - floor(max_hours) * 60) or 0, + seconds = floor(max_seconds - floor(max_minutes) * 60) or 0, } -- Remove units that are not requested