From 7b0001951ebea2e0cd352bdfca322e9b43ecac64 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 29 Dec 2018 08:22:37 +0000 Subject: [PATCH] fix check for non-zero running total didn't work when the running total is negative --- .../java/net/ktnx/mobileledger/NewTransactionActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java index 4e966e1f..e7d6ca4b 100644 --- a/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java @@ -398,8 +398,8 @@ public class NewTransactionActivity extends AppCompatActivity implements TaskCal else if (mSave != null) mSave.setVisible(false); if (single_empty_amount) { - empty_amount - .setHint(String.format("%1.2f", (running_total > 0) ? -running_total : 0f)); + empty_amount.setHint(String.format("%1.2f", + (Math.abs(running_total) > 0.005) ? -running_total : 0f)); } } -- 2.39.5