String amount = String.valueOf(tvAmount.getText());
amount = amount.trim();
- if (!amount.isEmpty()) {
+ if (amount.isEmpty()) {
+ item.getAccount()
+ .resetAmount();
+ }
+ else {
try {
amount = amount.replace(decimalSeparator, decimalDot);
item.getAccount()
catch (NumberFormatException e) {
Logger.debug("new-trans", String.format(
"assuming amount is not set due to number format exception. " +
- "input was '%s'",
- amount));
+ "input was '%s'", amount));
item.getAccount()
.resetAmount();
}
}
- else
- item.getAccount()
- .resetAmount();
break;
case bottomFiller: