From e9af411c3860d473edb00e3424a24f35a2d6aaae Mon Sep 17 00:00:00 2001 From: Shi Cheng Date: Mon, 21 Mar 2022 17:25:39 -0400 Subject: [PATCH] ROSE-230: Use integer to compare amount sign --- parser/match_operations.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser/match_operations.go b/parser/match_operations.go index 006e0b7d..0a1a7205 100644 --- a/parser/match_operations.go +++ b/parser/match_operations.go @@ -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 }