Rounded earn values from overview to two decimal digits.

This commit is contained in:
23rd
2024-10-31 16:04:30 +03:00
parent 68cc42047e
commit 46ab553fa5
6 changed files with 29 additions and 12 deletions

View File

@@ -43,7 +43,7 @@ void ChartRulersView::setChartData(
return FormatF(value / float64(Data::kEarnMultiplier));
};
_rightCustomCaption = [=, rate = chartData.currencyRate](float64 v) {
return Info::ChannelEarn::ToUsd(v, rate);
return Info::ChannelEarn::ToUsd(v, rate, 0);
};
_rightPen = QPen(st::windowSubTextFg);
}

View File

@@ -186,7 +186,10 @@ PointDetailsWidget::PointDetailsWidget(
QString::number(value / multiplier));
const auto usdText = Ui::Text::String(
_textStyle,
Info::ChannelEarn::ToUsd(value, _chartData.currencyRate));
Info::ChannelEarn::ToUsd(
value,
_chartData.currencyRate,
0));
const auto width = std::max(
usdText.maxWidth(),
valueText.maxWidth());
@@ -351,7 +354,7 @@ void PointDetailsWidget::setXIndex(int xIndex) {
_textStyle,
Info::ChannelEarn::ToUsd(
dataLine.y[xIndex],
_chartData.currencyRate));
_chartData.currencyRate, 0));
}
_lines.push_back(std::move(textLine));
}