From: Andrew Lewis Date: Mon, 12 Jun 2017 12:18:24 +0000 (+0200) Subject: [Minor] Milter headers x-spamd-result: format numbers, remove spaces X-Git-Tag: 1.6.0~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=39816ee9345e13bbbd04e63e511238e74c0a286e;p=rspamd.git [Minor] Milter headers x-spamd-result: format numbers, remove spaces --- 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')