case: Introduce new functions for numbers and substrings in cases.
[pspp] / src / math / box-whisker.c
index c30be218fd433705193ee6f6c184c29f54a7b6ed..344561a6fd24a0cdcd694778ba06733932427309 100644 (file)
@@ -40,7 +40,7 @@ destroy (struct statistic *s)
   struct order_stats *os = &bw->parent;
   struct ll *ll;
 
-  for (ll = ll_head (&bw->outliers); ll != ll_null (&bw->outliers); )
+  for (ll = ll_head (&bw->outliers); ll != ll_null (&bw->outliers);)
     {
       struct outlier *e = ll_data (ll, struct outlier, ll);
 
@@ -63,7 +63,7 @@ acc (struct statistic *s, const struct ccase *cx,
   bool extreme;
   struct outlier *o;
 
-  if ( y > bw->hinges[2] + bw->step) /* Upper outlier */
+  if (y > bw->hinges[2] + bw->step) /* Upper outlier */
     {
       extreme = (y > bw->hinges[2] + 2 * bw->step) ;
     }
@@ -80,7 +80,7 @@ acc (struct statistic *s, const struct ccase *cx,
 
       if (y > bw->whiskers[1])
        bw->whiskers[1] = y;
-         
+
       return;
     }
 
@@ -94,8 +94,9 @@ acc (struct statistic *s, const struct ccase *cx,
   if (bw->id_var)
     {
       char *s = data_out (case_data_idx (cx, bw->id_idx),
-                           var_get_encoding (bw->id_var),
-                           var_get_print_format (bw->id_var));
+                          var_get_encoding (bw->id_var),
+                          var_get_print_format (bw->id_var),
+                          settings_get_fmt_settings ());
 
       ds_put_cstr (&o->label, s);
       free (s);
@@ -104,7 +105,7 @@ acc (struct statistic *s, const struct ccase *cx,
     {
       ds_put_format (&o->label,
                      "%ld",
-                     (casenumber) case_data_idx (cx, bw->id_idx)->f);
+                     (casenumber) case_num_idx (cx, bw->id_idx));
     }
 
   ll_push_head (&bw->outliers, &o->ll);
@@ -136,7 +137,7 @@ box_whisker_outliers (const struct box_whisker *bw)
 
   TH are the tukey hinges of the dataset.
 
-  id_idx is the index into the casereader which will be used to label 
+  id_idx is the index into the casereader which will be used to label
   outliers.
   id_var is the variable from which that label came, or NULL
 */