DISPLAY: Display values for value labels using the variable's format.
[pspp-builds.git] / src / language / dictionary / sys-file-info.c
index fc875384c1ad31b3f2afc94cef644745bff9e9ce..7653e046bd7ea4b5f361f4eae47957fab5eff422 100644 (file)
@@ -584,18 +584,8 @@ describe_variable (const struct variable *v, struct tab_table *t, int r,
       for (i = 0; i < n_labels; i++)
         {
           const struct val_lab *vl = labels[i];
-         char buf[MAX_STRING + 1];
 
-         if (var_is_alpha (v))
-           {
-              int width = var_get_width (v);
-             memcpy (buf, value_str (&vl->value, width), width);
-             buf[width] = 0;
-           }
-         else
-           sprintf (buf, "%g", vl->value.f);
-
-         tab_text (t, 1, r, TAB_NONE, buf);
+         tab_value (t, 1, r, TAB_NONE, &vl->value, v, NULL);
          tab_text (t, 2, r, TAB_LEFT, val_lab_get_label (vl));
          r++;
        }