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
+3 -3
View File
@@ -418,14 +418,14 @@ double Utils::roundUp(double value, int decimal_places) {
return std::ceil(value * multiplier) / multiplier;
}
QString Utils::amountToCurrencyString(double amount, const QString &currencyCode) {
QString Utils::amountToCurrencyString(double amount, const QString &currencyCode, int precision) {
QLocale locale = getCurrencyLocale(currencyCode);
// \xC2\xA0 = UTF-8 non-breaking space, it looks off.
if (currencyCode == "USD")
return locale.toCurrencyString(amount, "$").remove("\xC2\xA0");
return locale.toCurrencyString(amount, "$", precision).remove("\xC2\xA0");
return locale.toCurrencyString(amount).remove("\xC2\xA0");
return locale.toCurrencyString(amount, nullptr, precision).remove("\xC2\xA0");
}
int Utils::maxLength(const QVector<QString> &array) {