price to 4 decimal digits
This commit is contained in:
parent
2934baee9d
commit
e0b4da831c
@ -78,16 +78,16 @@ public class MiningBean {
|
||||
if (pos>=0) {
|
||||
JSONObject quote = (JSONObject) o.get("quote");
|
||||
JSONObject usd = (JSONObject) quote.get(currency.toUpperCase());
|
||||
double res = usd.getDouble("price");
|
||||
double price = usd.getDouble("price");
|
||||
double change = usd.getDouble("percent_change_24h");
|
||||
|
||||
lastPrices[pos] = res;
|
||||
if (res > 0d)
|
||||
resultStr = curSym + res + " ("+String.format("%.2f",(change))+"%)";
|
||||
lastPrices[pos] = price;
|
||||
if (price > 0d)
|
||||
resultStr = curSym + String.format("%.4f",(price)) + " ("+String.format("%.2f",(change))+"%)";
|
||||
else
|
||||
resultStr = "Unknown";
|
||||
KeyValue wi = new KeyValue();
|
||||
wi.setKey(symbol.concat("/").concat(currency.toUpperCase()).concat(" (CoinMarketCap)"));
|
||||
wi.setKey(symbol.concat("/").concat(currency.toUpperCase()));
|
||||
wi.setValue(resultStr);
|
||||
if (change>0)
|
||||
wi.setColor("GREEN");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user