mirror of https://github.com/procxx/kepka.git
Use QLocale for amount + currency formatting.
This commit is contained in:
parent
fde769e0b9
commit
47c5d56c7b
|
@ -3448,11 +3448,12 @@ QString HistoryInvoice::fillAmountAndCurrency(int amount, const QString ¤c
|
||||||
{ qsl("EUR"), QString::fromUtf8("\xE2\x82\xAC") },
|
{ qsl("EUR"), QString::fromUtf8("\xE2\x82\xAC") },
|
||||||
{ qsl("JPY"), QString::fromUtf8("\xC2\xA5") },
|
{ qsl("JPY"), QString::fromUtf8("\xC2\xA5") },
|
||||||
};
|
};
|
||||||
auto amountBucks = amount / 100;
|
|
||||||
auto amountCents = amount % 100;
|
|
||||||
auto amountText = qsl("%1,%2").arg(amountBucks).arg(amountCents, 2, 10, QChar('0'));
|
|
||||||
auto currencyText = shortCurrencyNames.value(currency, currency);
|
auto currencyText = shortCurrencyNames.value(currency, currency);
|
||||||
return currencyText + amountText;
|
return QLocale::system().toCurrencyString(amount / 100., currencyText);
|
||||||
|
//auto amountBucks = amount / 100;
|
||||||
|
//auto amountCents = amount % 100;
|
||||||
|
//auto amountText = qsl("%1,%2").arg(amountBucks).arg(amountCents, 2, 10, QChar('0'));
|
||||||
|
//return currencyText + amountText;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryInvoice::fillFromData(const MTPDmessageMediaInvoice &data) {
|
void HistoryInvoice::fillFromData(const MTPDmessageMediaInvoice &data) {
|
||||||
|
|
Loading…
Reference in New Issue