Skip to content

Commit

Permalink
ROSE-230: Use integer to compare amount sign
Browse files Browse the repository at this point in the history
  • Loading branch information
shiatcb committed Mar 21, 2022
1 parent 43e28df commit e9af411
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parser/match_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ func (s AmountSign) Match(amount *types.Amount) bool {
return true
}

if s == PositiveOrZeroAmountSign && (numeric.Sign() == 1 || amount.Value == "0") {
if s == PositiveOrZeroAmountSign && (numeric.Sign() == 1 || len(numeric.Bits()) == 0) {
return true
}

if s == NegativeOrZeroAmountSign && (numeric.Sign() == -1 || amount.Value == "0") {
if s == NegativeOrZeroAmountSign && (numeric.Sign() == -1 || len(numeric.Bits()) == 0) {
return true
}

Expand Down

0 comments on commit e9af411

Please sign in to comment.