Change many %g format specifiers to %.*g with precision DBL_DIG + 1.
[pspp] / src / language / stats / regression.c
index 07188663fed2fe50793b10affb7b3f31f7aad958..0ef739a4e04e1d31a7a53b0089322ea9b8a7ef61 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <config.h>
 
+#include <float.h>
 #include <stdbool.h>
 
 #include <gsl/gsl_cdf.h>
@@ -949,9 +950,9 @@ reg_stats_anova (const linreg * c, const struct variable *var)
 
 
   /* Degrees of freedom */
-  tab_text_format (t, 3, 1, TAB_RIGHT, "%g", c->dfm);
-  tab_text_format (t, 3, 2, TAB_RIGHT, "%g", c->dfe);
-  tab_text_format (t, 3, 3, TAB_RIGHT, "%g", c->dft);
+  tab_text_format (t, 3, 1, TAB_RIGHT, "%.*g", DBL_DIG + 1, c->dfm);
+  tab_text_format (t, 3, 2, TAB_RIGHT, "%.*g", DBL_DIG + 1, c->dfe);
+  tab_text_format (t, 3, 3, TAB_RIGHT, "%.*g", DBL_DIG + 1, c->dft);
 
   /* Mean Squares */
   tab_double (t, 4, 1, TAB_RIGHT, msm, NULL);