Fixed display of integer numbers in channel earn section.

This commit is contained in:
23rd 2024-04-03 18:37:26 +03:00 committed by John Preston
parent e32de38d04
commit d675e31a51
1 changed files with 2 additions and 1 deletions

View File

@ -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;