JS: Prevent Amount#negate from creating amounts that are negative zero.

This commit is contained in:
Stefan Thomas
2013-02-22 13:47:26 +01:00
parent 50b5644334
commit 544105e23d

View File

@@ -276,6 +276,9 @@ Amount.prototype.copyTo = function (d, negate) {
this._currency.copyTo(d._currency);
this._issuer.copyTo(d._issuer);
// Prevent negative zero
if (d.is_zero()) d._is_negative = false;
return d;
};