web3: fixed toHex
This commit is contained in:
parent
9c05284bd1
commit
465796c3a8
|
@ -1137,10 +1137,10 @@ var toHex = function (val) {
|
|||
if (isString(val)) {
|
||||
if (val.indexOf('-0x') === 0)
|
||||
return fromDecimal(val);
|
||||
else if (!isFinite(val))
|
||||
return fromAscii(val);
|
||||
else if(val.indexOf('0x') === 0)
|
||||
return val;
|
||||
else if (!isFinite(val))
|
||||
return fromAscii(val);
|
||||
}
|
||||
|
||||
return fromDecimal(val);
|
||||
|
|
Loading…
Reference in New Issue