From 4125a4550397ca59964237ed635fcc1ced9b0482 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 2 May 2022 20:52:40 +0300 Subject: [PATCH] Slightly improved format of mute time in menu. --- Telegram/SourceFiles/ui/text/format_values.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/ui/text/format_values.cpp b/Telegram/SourceFiles/ui/text/format_values.cpp index 2cd269d311..b7b4591735 100644 --- a/Telegram/SourceFiles/ui/text/format_values.cpp +++ b/Telegram/SourceFiles/ui/text/format_values.cpp @@ -420,14 +420,16 @@ QString FormatMuteForTiny(float64 sec) { return (sec <= 60) ? QString() : (sec <= 60 * 59) - ? tr::lng_minutes_tiny(tr::now, lt_count, int(sec / 60)) + ? tr::lng_minutes_tiny(tr::now, lt_count, std::round(sec / 60)) : (sec <= 3600 * 23) - ? tr::lng_hours_tiny(tr::now, lt_count, int(sec / 3600)) + ? tr::lng_hours_tiny(tr::now, lt_count, std::round(sec / 3600)) : (sec <= 86400 * 6) - ? tr::lng_days_tiny(tr::now, lt_count, int(sec / 86400)) + ? tr::lng_days_tiny(tr::now, lt_count, std::round(sec / 86400)) : (sec <= (86400 * 7) * 3) - ? tr::lng_weeks_tiny(tr::now, lt_count, int(sec / (86400 * 7))) - : QString(); + ? tr::lng_weeks_tiny(tr::now, lt_count, std::round(sec / (86400 * 7))) + : (sec <= (86400 * 31) * 11) + ? tr::lng_months_tiny({}, lt_count, std::round(sec / (86400 * 31))) + : tr::lng_years_tiny({}, lt_count, std::round(sec / (86400 * 365))); } } // namespace Ui