The balance fiat display does not 'round to ceiling' anymore, instead introduced some more decimals:

![https://i.imgur.com/aZAonV4.png](https://i.imgur.com/aZAonV4.png)

New fiat columns in the history table:

- Historical price (`balance * historical fiat price`)
- Historical rate (the historical fiat price at that date)
- Current price (`balance * current fiat price`)

![https://i.imgur.com/QkWCLRf.png](https://i.imgur.com/QkWCLRf.png)

When preferred fiat is changed (in the settings), the balance fiat display now follows accordingly.

Requires https://git.wownero.com/wowlet/wowlet-backend/pulls/19
This commit is contained in:
dsc
2022-04-25 21:56:14 +02:00
parent 73747e05a7
commit 289f9ab1d2
10 changed files with 117 additions and 23 deletions
+9 -1
View File
@@ -282,6 +282,9 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
// settings connects
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, this, &MainWindow::onUpdateFiatBalanceWidget);
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, this, &MainWindow::onUpdateWowWidget);
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, this, &MainWindow::onUpdateBTCWidget);
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, this, &MainWindow::onUpdateXMRWidget);
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_ctx, &AppContext::onPreferredFiatCurrencyChanged);
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, ui->suchWowWidget, &SuchWowWidget::onPreferredFiatCurrencyChanged);
connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, ui->sendWidget, QOverload<>::of(&SendWidget::onPreferredFiatCurrencyChanged));
@@ -1411,7 +1414,12 @@ void MainWindow::onUpdateWowWidget() {
}
auto wowObj = AppContext::prices->markets["WOW"];
auto currencyText = Utils::amountToCurrencyString(wowObj.price_usd, fiatCurrency);
double amount = wowObj.price_usd;
if(fiatCurrency != "USD")
amount = AppContext::prices->convert("USD", fiatCurrency, amount);
auto currencyText = Utils::amountToCurrencyString(amount, fiatCurrency, 5);
m_tickerWOW->setFiatText(currencyText);
auto pct24h = AppContext::prices->markets["WOW"].price_usd_change_pct_24h;