mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-22 12:05:53 +00:00
JS: Prevent Amount#negate from creating amounts that are negative zero.
This commit is contained in:
@@ -276,6 +276,9 @@ Amount.prototype.copyTo = function (d, negate) {
|
|||||||
this._currency.copyTo(d._currency);
|
this._currency.copyTo(d._currency);
|
||||||
this._issuer.copyTo(d._issuer);
|
this._issuer.copyTo(d._issuer);
|
||||||
|
|
||||||
|
// Prevent negative zero
|
||||||
|
if (d.is_zero()) d._is_negative = false;
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user