mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user