diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-06-12 14:18:24 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-06-12 14:18:24 +0200 |
commit | 39816ee9345e13bbbd04e63e511238e74c0a286e (patch) | |
tree | dcfcd479c96a49c93884f2c303a6bf8ddc8402db | |
parent | 8c98df3ced1e8f76794dce50b4bb2590d395e544 (diff) | |
download | rspamd-39816ee9345e13bbbd04e63e511238e74c0a286e.tar.gz rspamd-39816ee9345e13bbbd04e63e511238e74c0a286e.zip |
[Minor] Milter headers x-spamd-result: format numbers, remove spaces
-rw-r--r-- | src/plugins/lua/milter_headers.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua index 6c160ad44..163b05501 100644 --- a/src/plugins/lua/milter_headers.lua +++ b/src/plugins/lua/milter_headers.lua @@ -139,12 +139,12 @@ local function milter_headers(task) local buf = {} table.insert(buf, table.concat({ 'default: ', (common['metric_action'] == 'reject') and 'True' or 'False', ' [', - common['metric_score'][1], ' / ', common['metric_score'][2], ']' + string.format('%.2f', common['metric_score'][1]), ' / ', string.format('%.2f', common['metric_score'][2]), ']' })) for _, s in ipairs(common.symbols) do if not s.options then s.options = {} end table.insert(buf, table.concat({ - ' ', s.name, ' (', s.score, ') [', table.concat(s.options, ','), ']', + ' ', s.name, '(', string.format('%.2f', s.score), ')[', table.concat(s.options, ','), ']', })) end add[settings.routines['x-spamd-result'].header] = table.concat(buf, '\n') |