diff options
-rw-r--r-- | src/lobject.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lobject.js b/src/lobject.js index a67147a..a70866d 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -508,12 +508,11 @@ const luaO_tostring = function(L, obj) { buff = defs.to_luastring(luaconf.lua_integer2str(obj.value)); else { let str = luaconf.lua_number2str(obj.value); - buff = defs.to_luastring(str); // Assume no LUA_COMPAT_FLOATSTRING if (/^[-0123456789]+$/.test(str)) { /* looks like an int? */ - buff.push(char[luaconf.lua_getlocaledecpoint()]); - buff.push(char['0']); /* adds '.0' to result */ + str += luaconf.lua_getlocaledecpoint() + '0'; /* adds '.0' to result */ } + buff = defs.to_luastring(str); } obj.setsvalue(lstring.luaS_bless(L, buff)); }; |