Skip to content

Commit

Permalink
fix Amount compare bug
Browse files Browse the repository at this point in the history
return 0 if values not comparable
  • Loading branch information
darkdarkdragon committed Aug 31, 2015
1 parent 572c945 commit 806547d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/amount.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit 806547d

Please sign in to comment.