mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-26 15:15:49 +00:00
More fixes for from_number.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user