From a9229d95094d7353f87fb9242a28a5f0399db019 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 19 Apr 2018 18:44:33 +0200 Subject: [PATCH] Display purchased price in transaction history --- .../coinfolio/Activities/CurrencyDetailsActivity.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java index 57d3ba0..2675a74 100644 --- a/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java +++ b/app/src/main/java/com/nauk/coinfolio/Activities/CurrencyDetailsActivity.java @@ -625,19 +625,14 @@ public class CurrencyDetailsActivity extends AppCompatActivity { private String numberConformer(double number) { String str; - DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.UK); - DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); - - symbols.setGroupingSeparator(' '); - formatter.setDecimalFormatSymbols(symbols); if(abs(number) > 1) { - str = formatter.format(number); + str = String.format( Locale.UK, "%.2f", number).replaceAll("\\.?0*$", ""); } else { - str = String.format( Locale.UK, "%.4f", number); + str = String.format( Locale.UK, "%.4f", number).replaceAll("\\.?0*$", ""); } return str; @@ -842,6 +837,7 @@ public class CurrencyDetailsActivity extends AppCompatActivity { }); amountTxtView.setText(String.valueOf(transactionList.get(i).getAmount())); + valueTxtView.setText(String.valueOf(transactionList.get(i).getPurchasedPrice())); setupSwipeView(view);