Merge pull request 'Balance: don't use scientific notation' (#13) from tobtoht/feather:balance_display into master

Reviewed-on: https://git.wownero.com/feather/feather/pulls/13
This commit is contained in:
dsc 2020-10-09 22:31:35 +00:00
commit 423b339ab5
2 changed files with 3 additions and 3 deletions

View file

@ -740,10 +740,10 @@ void AppContext::updateBalance() {
throw std::runtime_error("this should not happen, ever"); throw std::runtime_error("this should not happen, ever");
AppContext::balance = this->currentWallet->balance() / AppContext::cdiv; AppContext::balance = this->currentWallet->balance() / AppContext::cdiv;
auto balance_str = QString::number(balance); auto balance_str = QString::number(balance, 'f');
double unlocked = this->currentWallet->unlockedBalance() / AppContext::cdiv; double unlocked = this->currentWallet->unlockedBalance() / AppContext::cdiv;
auto unlocked_str = QString::number(unlocked); auto unlocked_str = QString::number(unlocked, 'f');
emit balanceUpdated(balance, unlocked, balance_str, unlocked_str); emit balanceUpdated(balance, unlocked, balance_str, unlocked_str);
} }

View file

@ -589,7 +589,7 @@ void MainWindow::onBalanceUpdated(double balance, double unlocked, const QString
qDebug() << Q_FUNC_INFO; qDebug() << Q_FUNC_INFO;
auto label_str = QString("Balance: %1 XMR").arg(unlocked_str); auto label_str = QString("Balance: %1 XMR").arg(unlocked_str);
if(balance > unlocked) if(balance > unlocked)
label_str += QString(" (+%1 XMR unconfirmed)").arg(balance - unlocked); label_str += QString(" (+%1 XMR unconfirmed)").arg(QString::number(balance - unlocked, 'f'));
m_statusLabelBalance->setText(label_str); m_statusLabelBalance->setText(label_str);
} }