From d675e31a510a5d6c38f5c386aba6b44348d594d5 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 3 Apr 2024 18:37:26 +0300 Subject: [PATCH] Fixed display of integer numbers in channel earn section. --- .../SourceFiles/info/channel_statistics/earn/earn_format.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/info/channel_statistics/earn/earn_format.cpp b/Telegram/SourceFiles/info/channel_statistics/earn/earn_format.cpp index e79fa89ce..ea470af93 100644 --- a/Telegram/SourceFiles/info/channel_statistics/earn/earn_format.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/earn/earn_format.cpp @@ -12,6 +12,7 @@ namespace Info::ChannelEarn { using EarnInt = Data::EarnInt; constexpr auto kMinorPartLength = 9; +constexpr auto kMaxChoppedZero = kMinorPartLength - 2; constexpr auto kZero = QChar('0'); constexpr auto kDot = QChar('.'); @@ -35,7 +36,7 @@ QString MinorPart(EarnInt value) { auto ch = end - 1; auto zeroCount = 0; while (ch != begin) { - if ((*ch) == kZero) { + if (((*ch) == kZero) && (zeroCount < kMaxChoppedZero)) { zeroCount++; } else { break;