Until now, the values in value labels have been displayed as plain
numbers, but this makes the values for variables with date and time
formats unreadable. Changing them to use the variable's own format
makes them easier to read.
for (i = 0; i < n_labels; i++)
{
const struct val_lab *vl = labels[i];
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++;
}
tab_text (t, 2, r, TAB_LEFT, val_lab_get_label (vl));
r++;
}
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
,Measure: Scale,,
,Display Alignment: Right,,
,Display Width: 8,,
-,1,oojars,
-,2,oojimiflips,
-,3,thingummies,
-,4,widgets,
+,1.00,oojars,
+,2.00,oojimiflips,
+,3.00,thingummies,
+,4.00,widgets,