starlit  Diff

Differences From Artifact [43eaf4251e]:

To Artifact [2d47a7e2f1]:


156
157
158
159
160
161
162

163
164
165
166

167
168
169
170
-- function fn.vlerp

function fn.timespec(n)
	if n == 0 then return '0s' end
	if n < 0 then return '-' .. fn.timespec(n*-1) end

	local sec = math.floor(n % 60)

	local hr = math.floor(n / 60)
	local spec = {}

	if hr  ~= 0 then table.insert(spec, string.format("%shr", hr))  end

	if sec ~= 0 then table.insert(spec, string.format("%ss",  sec)) end
	return table.concat(spec, ' ')
end
return fn







>
|



>




156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
-- function fn.vlerp

function fn.timespec(n)
	if n == 0 then return '0s' end
	if n < 0 then return '-' .. fn.timespec(n*-1) end

	local sec = math.floor(n % 60)
	local min = math.floor(n / 60)
	local hr = math.floor(min / 60)
	local spec = {}

	if hr  ~= 0 then table.insert(spec, string.format("%shr", hr))  end
	if min  ~= 0 then table.insert(spec, string.format("%sm", min))  end
	if sec ~= 0 then table.insert(spec, string.format("%ss",  sec)) end
	return table.concat(spec, ' ')
end
return fn