From 506aa88bf67d0c426b8614b58c81e2b246d2d1c8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 26 Nov 2026 23:47:12 +0100 Subject: fixed formatting floating point numbers 100.0 was formatted as "1" since all sequences of "0" and "." were stripped from the end. --- src/expressions.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/expressions.c b/src/expressions.c index de256df..a5a72ce 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -578,7 +578,9 @@ teco_expressions_format_float(gchar *buffer, teco_float_t number, guint precisio * On the other hand, this prints a fixed number of trailing zeros, so we * strip these afterwards. */ - while (p > buffer && (p[-1] == '0' || p[-1] == '.')) + while (p > buffer && p[-1] == '0') + p--; + if (p > buffer && p[-1] == '.') p--; *p = '\0'; return buffer; -- cgit v1.3