mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-21 13:12:50 +02:00
Slightly improved display of numbers approaching zero in stats charts.
This commit is contained in:
parent
a532067a93
commit
b0125e8165
2 changed files with 6 additions and 3 deletions
|
@ -22,7 +22,7 @@ constexpr auto kStep = 5.;
|
|||
}
|
||||
|
||||
[[nodiscard]] QString Format(ChartValue absoluteValue) {
|
||||
constexpr auto kTooMuch = ChartValue(10'000);
|
||||
static constexpr auto kTooMuch = ChartValue(10'000);
|
||||
return (absoluteValue >= kTooMuch)
|
||||
? Lang::FormatCountToShort(absoluteValue).string
|
||||
: QString::number(absoluteValue);
|
||||
|
|
|
@ -20,8 +20,11 @@ namespace Statistic {
|
|||
namespace {
|
||||
|
||||
[[nodiscard]] QString FormatF(float64 absoluteValue) {
|
||||
constexpr auto kTooMuch = int(10'000);
|
||||
return (absoluteValue >= kTooMuch)
|
||||
static constexpr auto kTooMuch = int(10'000);
|
||||
static constexpr auto kTooSmall = 1e-9;
|
||||
return (std::abs(absoluteValue) <= kTooSmall)
|
||||
? u"0"_q
|
||||
: (absoluteValue >= kTooMuch)
|
||||
? Lang::FormatCountToShort(absoluteValue).string
|
||||
: QString::number(absoluteValue);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue