From dea18e5ad48b340d462031a00afff1a35326d522 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 4 Mar 2021 23:22:59 +0200 Subject: [PATCH] save a setText() call that would not change anyting --- .../ui/new_transaction/NewTransactionItemHolder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java index 3b69110a..01c3bfdf 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java @@ -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 -- 2.39.5