Anonymous

Module:Number: Difference between revisions

From Melvor Idle
m
Fix parameter naming
m (Use hundreds of a second instead of seconds for timespan conversion in attempts of better accuracy)
m (Fix parameter naming)
Line 210: Line 210:
-- @return (TimeSpan) A TimeSpan object containing the seconds, minutes, hours and days the input amount of action time amounts to.
-- @return (TimeSpan) A TimeSpan object containing the seconds, minutes, hours and days the input amount of action time amounts to.
function p.actionTimeToTimeSpan(totalActionTime)
function p.actionTimeToTimeSpan(totalActionTime)
     local days = math.floor(totalSeconds / 8640000)
     local days = math.floor(totalActionTime / 8640000)
     local remainder = totalSeconds % 8640000
     local remainder = totalActionTime % 8640000


     local hours = math.floor(remainder / 360000)
     local hours = math.floor(remainder / 360000)
2,875

edits