From c82ff0575b11b811ccdba222ef1f865c36c8f2e1 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Fri, 26 Apr 2013 15:32:49 -0700 Subject: [PATCH] More fixes for from_number. --- src/js/amount.js | 2 +- src/js/uint160.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/amount.js b/src/js/amount.js index db006f9b..3d3fee8e 100644 --- a/src/js/amount.js +++ b/src/js/amount.js @@ -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(); diff --git a/src/js/uint160.js b/src/js/uint160.js index 52ef9728..830eeaa8 100644 --- a/src/js/uint160.js +++ b/src/js/uint160.js @@ -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;