commit 193d9de: [Minor] Use fixed floating point format

Vsevolod Stakhov vsevolod at rspamd.com
Tue Jun 14 20:14:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-06-14 21:08:14 +0100
URL: https://github.com/rspamd/rspamd/commit/193d9de3f0e9a9517f1ee019afd46bbf6cb63f57 (HEAD -> master)

[Minor] Use fixed floating point format

---
 src/client/rspamc.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/client/rspamc.cxx b/src/client/rspamc.cxx
index b7341be4f..f01ce58fd 100644
--- a/src/client/rspamc.cxx
+++ b/src/client/rspamc.cxx
@@ -826,7 +826,7 @@ rspamc_symbol_output(FILE *out, const ucl_object_t *obj)
 	const auto *val = ucl_object_lookup(obj, "score");
 
 	if (val != nullptr) {
-		fmt::print(out, "({:.2})", ucl_object_todouble(val));
+		fmt::print(out, "({:.2f})", ucl_object_todouble(val));
 	}
 	val = ucl_object_lookup(obj, "options");
 	if (val != nullptr && val->type == UCL_ARRAY) {
@@ -925,8 +925,8 @@ rspamc_metric_output(FILE *out, const ucl_object_t *obj)
 	if (got_scores == 2) {
 		fmt::print(out,
 				"Score: {} / {}\n",
-				emphasis_argument(score, "{:.2}"),
-				emphasis_argument(required_score, "{:.2}"));
+				emphasis_argument(score, "{:.2f}"),
+				emphasis_argument(required_score, "{:.2f}"));
 	}
 
 	elt = ucl_object_lookup(obj, "symbols");


More information about the Commits mailing list