Added decimal separators to count of credits in balances of owned bot.

This commit is contained in:
23rd 2024-10-28 17:46:42 +03:00
parent 119f109904
commit 057222757b
3 changed files with 4 additions and 4 deletions

View file

@ -1664,7 +1664,7 @@ void Controller::fillBotCreditsButton() {
auto &lifetime = _controls.buttonsLayout->lifetime(); auto &lifetime = _controls.buttonsLayout->lifetime();
const auto state = lifetime.make_state<State>(); const auto state = lifetime.make_state<State>();
if (const auto balance = _peer->session().credits().balance(_peer->id)) { if (const auto balance = _peer->session().credits().balance(_peer->id)) {
state->balance = QString::number(balance); state->balance = Lang::FormatCountDecimal(balance);
} }
const auto wrap = _controls.buttonsLayout->add( const auto wrap = _controls.buttonsLayout->add(
@ -1689,7 +1689,7 @@ void Controller::fillBotCreditsButton() {
if (data.balance) { if (data.balance) {
wrap->toggle(true, anim::type::normal); wrap->toggle(true, anim::type::normal);
} }
state->balance = QString::number(data.balance); state->balance = Lang::FormatCountDecimal(data.balance);
}); });
} }
{ {

View file

@ -124,7 +124,7 @@ void InnerWidget::fill() {
return _state.availableBalance; return _state.availableBalance;
}) })
); );
auto valueToString = [](uint64 v) { return QString::number(v); }; auto valueToString = [](uint64 v) { return Lang::FormatCountDecimal(v); };
if (data.revenueGraph.chart) { if (data.revenueGraph.chart) {
Ui::AddSkip(container); Ui::AddSkip(container);

View file

@ -926,7 +926,7 @@ rpl::producer<uint64> AddCreditsAction(
name->setMarkedText( name->setMarkedText(
base::duplicate(icon) base::duplicate(icon)
.append(QChar(' ')) .append(QChar(' '))
.append(QString::number(balance)), .append(Lang::FormatCountDecimal(balance)),
Core::MarkedTextContext{ Core::MarkedTextContext{
.session = &user->session(), .session = &user->session(),
.customEmojiRepaint = [=] { name->update(); }, .customEmojiRepaint = [=] { name->update(); },