]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix check for non-zero running total
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 29 Dec 2018 08:22:37 +0000 (08:22 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 29 Dec 2018 08:22:37 +0000 (08:22 +0000)
didn't work when the running total is negative

app/src/main/java/net/ktnx/mobileledger/NewTransactionActivity.java

index 4e966e1fb41d3eaadbe7ab60b39e959012161b75..e7d6ca4bade18eb947390e660946f4b1b7c30c53 100644 (file)
@@ -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));
             }
 
         }