Fix logic error in Amount.add which caused results to always be positive.

This commit is contained in:
Stefan Thomas
2013-01-22 21:46:08 +01:00
parent b4bcdc3fb7
commit 39c857f4d8

View File

@@ -554,10 +554,9 @@ Amount.prototype.add = function (v) {
result._offset = o1;
result._value = v1.add(v2);
result._is_negative = result._value.compareTo(BigInteger.ZERO) < 0;
if (result._is_negative) {
result._value = result._value.negate();
result._is_negative = false;
}
result._currency = this._currency.clone();