Change many %g format specifiers to %.*g with precision DBL_DIG + 1.
[pspp] / src / language / stats / cochran.c
index 3b6af22d6d512bc14fd6285fb9ac08ce878f643c..869e5f5c8332759ede3a2fc602bac0150ff88ede 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011, 2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include <config.h>
 
-#include "cochran.h"
-#include "npar.h"
-#include <stdbool.h>
-#include <libpspp/cast.h>
-#include <libpspp/message.h>
-#include <libpspp/misc.h>
-
-#include <data/procedure.h>
-#include <data/dictionary.h>
-#include <data/variable.h>
-#include <data/val-type.h>
-#include <data/casereader.h>
+#include "language/stats/cochran.h"
 
+#include <float.h>
 #include <gsl/gsl_cdf.h>
+#include <stdbool.h>
+
+#include "data/casereader.h"
+#include "data/dataset.h"
+#include "data/dictionary.h"
+#include "data/format.h"
+#include "data/val-type.h"
+#include "data/variable.h"
+#include "language/stats/npar.h"
+#include "libpspp/cast.h"
+#include "libpspp/message.h"
+#include "libpspp/misc.h"
+#include "output/tab.h"
 
-#include <data/format.h>
-#include <output/tab.h>
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
-
 struct cochran
 {
   double success;
@@ -170,8 +170,10 @@ show_freqs_box (const struct one_sample_test *ost, const struct cochran *ct)
   tab_joint_text (table, 1, 0, 2, 0,
                  TAT_TITLE | TAB_CENTER, _("Value"));
 
-  tab_text_format (table, 1, 1, 0, _("Success (%g)"), ct->success);
-  tab_text_format (table, 2, 1, 0, _("Failure (%g)"), ct->failure);
+  tab_text_format (table, 1, 1, 0, _("Success (%.*g)"),
+                   DBL_DIG + 1, ct->success);
+  tab_text_format (table, 2, 1, 0, _("Failure (%.*g)"),
+                   DBL_DIG + 1, ct->failure);
 
   tab_hline (table, TAL_2, 0, tab_nc (table) - 1, column_headers);
   tab_vline (table, TAL_2, row_headers, 0, tab_nr (table) - 1);