(_seconds: string | number = '0', showSeconds = true)
| 172 | } |
| 173 | |
| 174 | export 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 | |
| 184 | export function size(s: number, base = 1) { |
| 185 | s *= base; |
no test coverage detected