util: minor.

This commit is contained in:
Christopher Jeffrey 2017-08-06 01:35:25 -07:00
parent faabd36f9e
commit 5513563892
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -865,7 +865,10 @@ util.fromFixed = function fromFixed(str, exp) {
while (lo.length < exp)
lo += '0';
assert(/^\d*$/.test(hi) && /^\d*$/.test(lo),
if (lo.length === 0)
lo = '0';
assert(/^\d+$/.test(hi) && /^\d+$/.test(lo),
'Non-numeric characters in fixed number string.');
hi = parseInt(hi, 10);