mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Slightly improved display of numbers approaching zero in stats charts.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user