mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fixed display of growth rate in statistics info for huge values.
This commit is contained in:
parent
a35f020f56
commit
f4a09a9ca0
1 changed files with 3 additions and 1 deletions
|
@ -349,12 +349,14 @@ void FillOverview(
|
|||
const auto diffText = diffAbs > kTooMuchDiff
|
||||
? Lang::FormatCountToShort(std::abs(diff)).string
|
||||
: QString::number(diffAbs);
|
||||
const auto percentage = std::abs(v.growthRatePercentage);
|
||||
const auto precision = (percentage == int(percentage)) ? 0 : 1;
|
||||
return {
|
||||
(diff < 0 ? st::menuIconAttentionColor : st::settingsIconBg2)->c,
|
||||
QString("%1%2 (%3%)")
|
||||
.arg((diff < 0) ? QChar(0x2212) : QChar(0x002B))
|
||||
.arg(diffText)
|
||||
.arg(std::abs(std::round(v.growthRatePercentage * 10.) / 10.))
|
||||
.arg(QString::number(percentage, 'f', precision))
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue