]> git.ktnx.net Git - mobile-ledger.git/commitdiff
save a setText() call that would not change anyting
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 4 Mar 2021 21:22:59 +0000 (23:22 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 4 Mar 2021 21:22:59 +0000 (23:22 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java

index 3b69110a7c99cb8f75dc41e16e42c3a32f3e0da9..01c3bfdf7d07667025666542ba746a17cc5afa5f 100644 (file)
@@ -124,8 +124,9 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                     try {
                         String input = String.valueOf(b.accountRowAccAmounts.getText());
                         input = input.replace(decimalSeparator, decimalDot);
-                        b.accountRowAccAmounts.setText(
-                                String.format("%4.2f", Float.parseFloat(input)));
+                        final String newText = String.format("%4.2f", Float.parseFloat(input));
+                        if (!newText.equals(input))
+                            b.accountRowAccAmounts.setText(newText);
                     }
                     catch (NumberFormatException ex) {
                         // ignored