MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / formatSeconds

Function formatSeconds

framework/utils/lib/common.ts:174–182  ·  view source on GitHub ↗
(_seconds: string | number = '0', showSeconds = true)

Source from the content-addressed store, hash-verified

172}
173
174export function formatSeconds(_seconds: string | number = '0', showSeconds = true) {
175 const seconds = +_seconds;
176 let res = '{0}:{1}'.format(
177 showSeconds ? _digit2(Math.floor(seconds / 3600)) : Math.floor(seconds / 3600),
178 _digit2(Math.floor((seconds % 3600) / 60)),
179 );
180 if (showSeconds) res += `:${_digit2(seconds % 60)}`;
181 return res;
182}
183
184export function size(s: number, base = 1) {
185 s *= base;

Callers 3

updateProgressFunction · 0.90
registerFunction · 0.90
scoreboardRowFunction · 0.90

Calls 1

_digit2Function · 0.85

Tested by

no test coverage detected