From: Damyan Ivanov Date: Sat, 29 Dec 2018 08:22:37 +0000 (+0000) Subject: fix check for non-zero running total X-Git-Tag: v0.3~162 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=7b0001951ebea2e0cd352bdfca322e9b43ecac64;p=mobile-ledger.git fix check for non-zero running total didn't work when the running total is negative --- 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)); } }