More fixes for from_number.

This commit is contained in:
Arthur Britto
2013-04-26 15:32:49 -07:00
parent 3ce811ccdd
commit c82ff0575b
2 changed files with 2 additions and 2 deletions

View File

@@ -633,7 +633,7 @@ Amount.prototype.parse_number = function (n) {
this._currency = Currency.from_json(1);
this._issuer = UInt160.from_json(1);
this._is_negative = n < 0 ? 1 : 0;
this._value = new BigInteger(this._is_negative ? -n : n);
this._value = new BigInteger(String(this._is_negative ? -n : n));
this._offset = 0;
this.canonicalize();

View File

@@ -38,7 +38,7 @@ UInt160.prototype.parse_json = function (j) {
j = config.accounts[j].account;
if ('number' === typeof j) {
this._value = new BigInteger(j);
this._value = new BigInteger(String(j));
}
else if ('string' !== typeof j) {
this._value = NaN;