mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 07:35:52 +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._currency = Currency.from_json(1);
|
||||||
this._issuer = UInt160.from_json(1);
|
this._issuer = UInt160.from_json(1);
|
||||||
this._is_negative = n < 0 ? 1 : 0;
|
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._offset = 0;
|
||||||
|
|
||||||
this.canonicalize();
|
this.canonicalize();
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ UInt160.prototype.parse_json = function (j) {
|
|||||||
j = config.accounts[j].account;
|
j = config.accounts[j].account;
|
||||||
|
|
||||||
if ('number' === typeof j) {
|
if ('number' === typeof j) {
|
||||||
this._value = new BigInteger(j);
|
this._value = new BigInteger(String(j));
|
||||||
}
|
}
|
||||||
else if ('string' !== typeof j) {
|
else if ('string' !== typeof j) {
|
||||||
this._value = NaN;
|
this._value = NaN;
|
||||||
|
|||||||
Reference in New Issue
Block a user