Модуль:Code/Формат/Время: различия между версиями
Pok (обсуждение | вклад) Новая страница: «local p = {} local function format_time(mode, value) local total_seconds = mode == "minutes" and (value * 60) or value local hours = math.floor(total_seconds / 3600) local minutes = math.floor((total_seconds % 3600) / 60) local seconds = total_seconds % 60 local parts = {} if hours > 0 then table.insert(parts, hours .. " час." .. (hours > 1 and "а" or "")) end if minutes > 0 then table.inser...» |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 11: | Строка 11: | ||
if hours > 0 then | if hours > 0 then | ||
table.insert(parts, hours .. " час." | table.insert(parts, hours .. " час.") | ||
end | end | ||
if minutes > 0 then | if minutes > 0 then | ||