format the variable according to its print format, instead of
always effectively using A or F format.
+Sun Jun 25 22:39:32 2006 Ben Pfaff <blp@gnu.org>
+
+ * value-labels.c (value_to_string): When there's no value label,
+ format the variable according to its print format, instead of
+ always effectively using A or F format.
+
Mon Jun 19 18:05:42 WST 2006 John Darrington <john@darrington.wattle.id.au>
* casefile.c (casefile_get_random_reader): Nasty hack to get around
s = val_labs_find (var->val_labs, *val);
if (s == NULL)
{
- static char buf[256];
- if (var->width != 0)
- str_copy_buf_trunc (buf, sizeof buf, val->s, var->width);
- else
- snprintf(buf, 100, "%g", val->f);
+ static char buf[MAX_STRING + 1];
+ data_out (buf, &var->print, val);
+ buf[var->print.w] = '\0';
s = buf;
}