diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-06-02 17:56:32 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-06-02 17:56:32 +0200 |
commit | b8b79e3c59f3675b6e1c417f8d0d65335de1a873 (patch) | |
tree | a51fb8e863075e0081f6fe4d4c4483c8308db02f /lualib/lua_util.lua | |
parent | 543b1c25cf4bd5b3e2bd263b53466c644a231b2b (diff) | |
download | rspamd-b8b79e3c59f3675b6e1c417f8d0d65335de1a873.tar.gz rspamd-b8b79e3c59f3675b6e1c417f8d0d65335de1a873.zip |
[Minor] lua_util.round: don't round up
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r-- | lualib/lua_util.lua | 2 |
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 |