]> source.dussan.org Git - rspamd.git/commitdiff
Fix percents display in rspamc.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 14 Nov 2014 15:53:34 +0000 (15:53 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 14 Nov 2014 15:53:34 +0000 (15:53 +0000)
src/client/rspamc.c

index ecae8cbcc4012489c62873cb1d7c3816cdb5b8ae..4dd054725b7530200fe09ae2826ddd9a655d169a 100644 (file)
@@ -631,16 +631,16 @@ rspamc_stat_actions (ucl_object_t *obj, GString *out, gint64 scanned)
                        gint64 cnt = ucl_object_toint (cur);
                        rspamd_printf_gstring (out, "Messages with action %s: %L"
                                ", %.2f%%\n", ucl_object_key (cur), cnt,
-                               (gdouble)cnt / (gdouble)scanned);
+                               ((gdouble)cnt / (gdouble)scanned) * 100.);
                }
        }
 
        spam = ucl_object_toint (ucl_object_find_key (obj, "spam_count"));
        ham = ucl_object_toint (ucl_object_find_key (obj, "ham_count"));
        rspamd_printf_gstring (out, "Messages treated as spam: %L, %.2f%%\n", spam,
-               (gdouble)spam / (gdouble)scanned);
+               ((gdouble)spam / (gdouble)scanned) * 100.);
        rspamd_printf_gstring (out, "Messages treated as ham: %L, %.2f%%\n", ham,
-               (gdouble)ham / (gdouble)scanned);
+               ((gdouble)ham / (gdouble)scanned) * 100.);
 }
 
 static void