@@ -324,9 +324,8 @@ void PointDetailsWidget::setXIndex(int xIndex) {
324324 nullptr ,
325325 { float64 (xIndex), float64 (xIndex) }).parts
326326 : std::vector<PiePartData::Part>();
327- const auto multiplier = float64 (kOneStarInNano );
328327 const auto isCredits
329- = _chartData.currency == Data::StatisticalCurrency::Credits;
328+ = ( _chartData.currency == Data::StatisticalCurrency::Credits) ;
330329 for (auto i = 0 ; i < _chartData.lines .size (); i++) {
331330 const auto &dataLine = _chartData.lines [i];
332331 auto textLine = Line ();
@@ -350,19 +349,23 @@ void PointDetailsWidget::setXIndex(int xIndex) {
350349 ? tr::lng_channel_earn_chart_overriden_detail_credits
351350 : tr::lng_channel_earn_chart_overriden_detail_currency)(
352351 tr::now));
352+ const auto provided = dataLine.y [xIndex];
353+ const auto value = isCredits
354+ ? CreditsAmount (provided, CreditsType::Stars)
355+ : CreditsAmount (
356+ provided / kOneStarInNano ,
357+ provided % kOneStarInNano ,
358+ CreditsType::Ton);
353359 copy.value .setText (
354360 _textStyle,
355- Lang::FormatExactCountDecimal (
356- dataLine.y [xIndex] / multiplier));
361+ Lang::FormatCreditsAmountDecimal (value));
357362 _lines.push_back (std::move (copy));
358363 textLine.name .setText (
359364 _textStyle,
360365 tr::lng_channel_earn_chart_overriden_detail_usd (tr::now));
361366 textLine.value .setText (
362367 _textStyle,
363- Info::ChannelEarn::ToUsd (
364- dataLine.y [xIndex] / multiplier,
365- _chartData.currencyRate , 0 ));
368+ Info::ChannelEarn::ToUsd (value, _chartData.currencyRate , 0 ));
366369 }
367370 _lines.push_back (std::move (textLine));
368371 }
0 commit comments