From b8b79e3c59f3675b6e1c417f8d0d65335de1a873 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Fri, 2 Jun 2017 17:56:32 +0200 Subject: [PATCH] [Minor] lua_util.round: don't round up --- lualib/lua_util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua index 81e4cb606..0a824dca1 100644 --- a/lualib/lua_util.lua +++ b/lualib/lua_util.lua @@ -27,7 +27,7 @@ end -- Robert Jay Gould http://lua-users.org/wiki/SimpleRound exports.round = function(num, numDecimalPlaces) local mult = 10^(numDecimalPlaces or 0) - return math.floor(num * mult + 0.5) / mult + return math.floor(num * mult) / mult end return exports -- 2.39.5