aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-06-02 17:56:32 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-06-02 17:56:32 +0200
commitb8b79e3c59f3675b6e1c417f8d0d65335de1a873 (patch)
treea51fb8e863075e0081f6fe4d4c4483c8308db02f
parent543b1c25cf4bd5b3e2bd263b53466c644a231b2b (diff)
downloadrspamd-b8b79e3c59f3675b6e1c417f8d0d65335de1a873.tar.gz
rspamd-b8b79e3c59f3675b6e1c417f8d0d65335de1a873.zip
[Minor] lua_util.round: don't round up
-rw-r--r--lualib/lua_util.lua2
1 files changed, 1 insertions, 1 deletions
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