mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-02 08:16:56 +00:00
fix Amount compare bug
return 0 if values not comparable
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user