From 806547dd154e1b0bf252e8a74ad3ac6aa8a97660 Mon Sep 17 00:00:00 2001 From: Ivan Tivonenko Date: Tue, 1 Sep 2015 01:29:37 +0300 Subject: [PATCH] fix Amount compare bug return 0 if values not comparable --- src/amount.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amount.js b/src/amount.js index 41a41512..8a4813fc 100644 --- a/src/amount.js +++ b/src/amount.js @@ -388,7 +388,7 @@ Amount.prototype._copy = function(value) { Amount.prototype.compareTo = function(to) { var toAmount = Amount.from_json(to); if (!this.is_comparable(toAmount)) { - return new Amount(NaN); + return 0; } return this._value.comparedTo(toAmount._value); };