Skip to content

Commit

Permalink
Merge pull request #391 from shiatcb/ROSE-230
Browse files Browse the repository at this point in the history
ROSE-230: Use integer to compare amount sign
  • Loading branch information
xiaying-peng authored Mar 21, 2022
2 parents 43e28df + e9af411 commit de67541
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 de67541

Please sign in to comment.