Skip to content

Commit

Permalink
Parsing credit and debit amounts correctly detects when both amounts …
Browse files Browse the repository at this point in the history
…are present (bug fix)
  • Loading branch information
stonish committed Aug 24, 2022
1 parent 383e08d commit 420c899
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transactions/aibTransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (t aibTransaction) Output() {
func (t aibTransaction) parseAmount(debitAmount string, creditAmount string) (float64, error) {
var amount float64

if debitAmount == "" && creditAmount == "" {
if debitAmount != "" && creditAmount != "" {
return amount, errors.New("Transaction with both credit and debit amounts found")
}

Expand Down

0 comments on commit 420c899

Please sign in to comment.