Fix imprecise serialization of large numbers
authorShadowNinja <shadowninja@minetest.net>
Mon, 26 Jan 2015 01:19:35 +0000 (20:19 -0500)
committerShadowNinja <shadowninja@minetest.net>
Mon, 26 Jan 2015 01:19:35 +0000 (20:19 -0500)
builtin/common/serialize.lua

index b7643b2f4c1c15842729f93aa14a4a44472a8aba..24b2a12ee3be9e2219ecdfbcf2f9393cf7710254 100644 (file)
@@ -115,7 +115,7 @@ function core.serialize(x)
        function dump_val(x)
                local  tp = type(x)
                if     x  == nil        then return "nil"
-               elseif tp == "number"   then return tostring(x)
+               elseif tp == "number"   then return string.format("%d", x)
                elseif tp == "string"   then return string.format("%q", x)
                elseif tp == "boolean"  then return x and "true" or "false"
                elseif tp == "function" then