summaryrefslogtreecommitdiff
path: root/src/lbaselib.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r--src/lbaselib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js
index bffe5a6..613adc0 100644
--- a/src/lbaselib.js
+++ b/src/lbaselib.js
@@ -162,7 +162,7 @@ const luaB_tonumber = function(L) {
return 1;
} else {
let s = lua.lua_tostring(L, 1);
- if (s !== null && lua.lua_stringtonumber(L, s) === s.length)
+ if (s !== null && lua.lua_stringtonumber(L, s) === s.length+1)
return 1; /* successful conversion to number */
}
} else {