From 6e98dfac7384f6d8f1c2b84c0e175e72ca10aacf Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 7 Aug 2020 11:20:57 +0200 Subject: [PATCH] Corrected displayed money value in the split editor. Commit c1a40f351e1c3c21324705cdf0307571a806d9a8 changed the way the money amount is displayed in the split editor. If you entered a decimal value in a split transaction, saved and then edited the split again, the values now seemed to be rounded and you would have to enter the correct values again to make changes. -> Deleted toShortString method in Money and changed it to toLocaleString in AccountType.displayBalance(). codinguser/gnucash-android#876 --- .../main/java/org/gnucash/android/model/AccountType.java | 4 ++-- app/src/main/java/org/gnucash/android/model/Money.java | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/gnucash/android/model/AccountType.java b/app/src/main/java/org/gnucash/android/model/AccountType.java index 6826f598b..2d3e6aa65 100644 --- a/app/src/main/java/org/gnucash/android/model/AccountType.java +++ b/app/src/main/java/org/gnucash/android/model/AccountType.java @@ -154,8 +154,8 @@ public void displayBalance(final TextView balanceTextView, // Display value without currency and without decimals balanceTextView.setText(!shallDisplayNegativeSignum ? balanceToDisplay.abs() - .toShortString() - : balanceToDisplay.toShortString()); + .toLocaleString() + : balanceToDisplay.toLocaleString()); } else { // Shall not display balance diff --git a/app/src/main/java/org/gnucash/android/model/Money.java b/app/src/main/java/org/gnucash/android/model/Money.java index e2df19714..a3d075147 100644 --- a/app/src/main/java/org/gnucash/android/model/Money.java +++ b/app/src/main/java/org/gnucash/android/model/Money.java @@ -448,15 +448,6 @@ public String toPlainString(){ return mAmount.setScale(mCommodity.getSmallestFractionDigits(), ROUNDING_MODE).toPlainString(); } - /** - * Returns a locale-specific representation of the amount of the Money object (excluding the currency) - * - * @return String representation of the amount (without currency) of the Money object - */ - public String toShortString(){ - return String.format(Locale.getDefault(), "%.0f", asDouble()); - } - /** * Returns a locale-specific representation of the amount of the Money object (excluding the currency) *