[goffice] Regression Equations: show only 3 decimals for R^2.



commit 7943b42cdd6538b160f5686dfe2243a3327a2899
Author: Morten Welinder <terra gnome org>
Date:   Wed Mar 17 18:28:50 2021 -0400

    Regression Equations: show only 3 decimals for R^2.
    
    There isn't any point that I know of in distinguishing finer than
    that (or even that fine).

 ChangeLog                 | 3 +++
 NEWS                      | 1 +
 goffice/graph/gog-label.c | 4 ++--
 3 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ab3599898..a0d1258fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2021-03-17  Morten Welinder  <terra gnome org>
 
+       * goffice/graph/gog-label.c (gog_reg_eqn_get_str): Show only three
+       decimals for R^2.
+
        * plugins/reg_linear/gog-lin-reg.c
        (gog_lin_reg_curve_get_equation): Simplify code using fewer
        branches.
diff --git a/NEWS b/NEWS
index 605abe77f..78b8b42e8 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ goffice 0.10.50:
 
 Morten:
        * Simplify regression equation code.
+       * Use only 3 decimals for R^2 for regression lines.
 
 --------------------------------------------------------------------------
 goffice 0.10.49:
diff --git a/goffice/graph/gog-label.c b/goffice/graph/gog-label.c
index bfd3cc89f..9e7ef3f37 100644
--- a/goffice/graph/gog-label.c
+++ b/goffice/graph/gog-label.c
@@ -600,10 +600,10 @@ gog_reg_eqn_get_str (GogText *text)
                        NULL;
        else
                return reg_eqn->show_eq ?
-                       g_strdup_printf ("%s\r\nR² = %g",
+                       g_strdup_printf ("%s\r\nR² = %.3f",
                                         gog_reg_curve_get_equation (reg_curve),
                                         gog_reg_curve_get_R2 (reg_curve)) :
-                       g_strdup_printf ("R² = %g", gog_reg_curve_get_R2 (reg_curve));
+                       g_strdup_printf ("R² = %.3f", gog_reg_curve_get_R2 (reg_curve));
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]