Browse Source

Add JPY, KRW, RUB, SGD and render currency symbols correctly

pull/140/head
Duke Leto 4 years ago
parent
commit
041900bef5
  1. 2
      src/rpc.cpp
  2. 3
      src/settings.cpp
  3. 25
      src/settings.ui

2
src/rpc.cpp

@ -1093,7 +1093,7 @@ void RPC::refreshPrice() {
return noConnection();
// TODO: use/render all this data
QString price_feed = "https://api.coingecko.com/api/v3/simple/price?ids=hush&vs_currencies=btc%2Cusd%2Ceur%2Ceth%2Cgbp%2Ccny%2Cjpy%2Crub%2Ccad%2Csgd%2Cchf%2Cinr%2Caud%2Cinr&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true";
QString price_feed = "https://api.coingecko.com/api/v3/simple/price?ids=hush&vs_currencies=btc%2Cusd%2Ceur%2Ceth%2Cgbp%2Ccny%2Cjpy%2Crub%2Ccad%2Csgd%2Cchf%2Cinr%2Caud%2Cinr%2Ckrw&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true";
QUrl cmcURL(price_feed);
QNetworkRequest req;
req.setUrl(cmcURL);

3
src/settings.cpp

@ -280,7 +280,8 @@ void Settings::saveRestore(QDialog* d) {
}
QString Settings::getUSDFormat(double bal) {
return "$" + QLocale(QLocale::English).toString(bal * Settings::getInstance()->getZECPrice(), 'f', 2);
//TODO: respect current locale!
return QLocale(QLocale::English).toString(bal * Settings::getInstance()->getZECPrice(), 'f', 2) + " " + QString::fromStdString(Settings::getInstance()->get_currency_name());
}
QString Settings::getDecimalString(double amt) {

25
src/settings.ui

@ -200,11 +200,6 @@
<string>AUD</string>
</property>
</item>
<item>
<property name="text">
<string>BTC</string>
</property>
</item>
<item>
<property name="text">
<string>CAD</string>
@ -235,6 +230,26 @@
<string>INR</string>
</property>
</item>
<item>
<property name="text">
<string>JPY</string>
</property>
</item>
<item>
<property name="text">
<string>KRW</string>
</property>
</item>
<item>
<property name="text">
<string>RUB</string>
</property>
</item>
<item>
<property name="text">
<string>SGD</string>
</property>
</item>
<item>
<property name="text">
<string>USD</string>

Loading…
Cancel
Save