mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed display of integer numbers in channel earn section.
This commit is contained in:
parent
e32de38d04
commit
d675e31a51
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ namespace Info::ChannelEarn {
|
||||||
using EarnInt = Data::EarnInt;
|
using EarnInt = Data::EarnInt;
|
||||||
|
|
||||||
constexpr auto kMinorPartLength = 9;
|
constexpr auto kMinorPartLength = 9;
|
||||||
|
constexpr auto kMaxChoppedZero = kMinorPartLength - 2;
|
||||||
constexpr auto kZero = QChar('0');
|
constexpr auto kZero = QChar('0');
|
||||||
constexpr auto kDot = QChar('.');
|
constexpr auto kDot = QChar('.');
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ QString MinorPart(EarnInt value) {
|
||||||
auto ch = end - 1;
|
auto ch = end - 1;
|
||||||
auto zeroCount = 0;
|
auto zeroCount = 0;
|
||||||
while (ch != begin) {
|
while (ch != begin) {
|
||||||
if ((*ch) == kZero) {
|
if (((*ch) == kZero) && (zeroCount < kMaxChoppedZero)) {
|
||||||
zeroCount++;
|
zeroCount++;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue