From 8711d4499162ed7f18718c577bf03c4a19592367 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Wed, 15 Jun 2022 18:14:26 +0800 Subject: [PATCH] monitor-config-store: Only save 3 decimal places of Because elsewhere we already ignore precision beyond that. It's also easier to read rounded to 3 places than 15 decimal places. 59.996623992919922 -> 59.997 Part-of: --- src/backends/meta-monitor-config-store.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c index eaed9592f..4f6d03d67 100644 --- a/src/backends/meta-monitor-config-store.c +++ b/src/backends/meta-monitor-config-store.c @@ -1465,10 +1465,6 @@ append_monitors (GString *buffer, for (l = monitor_configs; l; l = l->next) { MetaMonitorConfig *monitor_config = l->data; - char rate_str[G_ASCII_DTOSTR_BUF_SIZE]; - - g_ascii_dtostr (rate_str, sizeof (rate_str), - monitor_config->mode_spec->refresh_rate); g_string_append (buffer, " \n"); append_monitor_spec (buffer, monitor_config->monitor_spec, " "); @@ -1477,8 +1473,8 @@ append_monitors (GString *buffer, monitor_config->mode_spec->width); g_string_append_printf (buffer, " %d\n", monitor_config->mode_spec->height); - g_string_append_printf (buffer, " %s\n", - rate_str); + g_string_append_printf (buffer, " %.3f\n", + monitor_config->mode_spec->refresh_rate); if (monitor_config->mode_spec->flags & META_CRTC_MODE_FLAG_INTERLACE) g_string_append_printf (buffer, " interlace\n"); g_string_append (buffer, " \n");