struct hsh_table *data; /* Undifferentiated data. */
struct freq_mutable *valid; /* Valid freqs. */
int n_valid; /* Number of total freqs. */
+ const struct dictionary *dict; /* The dict from whence entries in the table
+ come */
struct freq_mutable *missing; /* Missing freqs. */
int n_missing; /* Number of missing freqs. */
}
vf = var_attach_aux (v, xmalloc (sizeof *vf), var_dtor_free);
vf->tab.valid = vf->tab.missing = NULL;
+ vf->tab.dict = dataset_dict (ds);
vf->n_groups = 0;
vf->groups = NULL;
vf->width = var_get_width (v);
tab_text (t, 0, r, TAB_LEFT, label);
}
- tab_value (t, 0 + lab, r, TAB_NONE, &f->value, &vf->print);
+ tab_value (t, 0 + lab, r, TAB_NONE, &f->value, ft->dict, &vf->print);
tab_double (t, 1 + lab, r, TAB_NONE, f->count, wfmt);
tab_double (t, 2 + lab, r, TAB_NONE, percent, NULL);
tab_double (t, 3 + lab, r, TAB_NONE, valid_percent, NULL);
tab_text (t, 0, r, TAB_LEFT, label);
}
- tab_value (t, 0 + lab, r, TAB_NONE, &f->value, &vf->print);
+ tab_value (t, 0 + lab, r, TAB_NONE, &f->value, ft->dict, &vf->print);
tab_double (t, 1 + lab, r, TAB_NONE, f->count, wfmt);
tab_double (t, 2 + lab, r, TAB_NONE,
f->count / ft->total_cases * 100.0, NULL);
percent = f->count / ft->total_cases * 100.0;
cum_total += f->count / ft->valid_cases * 100.0;
- tab_value (t, 0, r, TAB_NONE, &f->value, &vf->print);
+ tab_value (t, 0, r, TAB_NONE, &f->value, ft->dict, &vf->print);
tab_double (t, 1, r, TAB_NONE, f->count, wfmt);
tab_double (t, 2, r, TAB_NONE, percent, NULL);
tab_double (t, 3, r, TAB_NONE, cum_total, NULL);
}
for (; f < &ft->valid[n_categories]; f++)
{
- tab_value (t, 0, r, TAB_NONE, &f->value, &vf->print);
+ tab_value (t, 0, r, TAB_NONE, &f->value, ft->dict, &vf->print);
tab_double (t, 1, r, TAB_NONE, f->count, wfmt);
tab_double (t, 2, r, TAB_NONE,
f->count / ft->total_cases * 100.0, NULL);
#include <data/data-out.h>
#include <data/format.h>
#include <data/value.h>
+#include <data/dictionary.h>
#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
#include <libpspp/misc.h>
from V, displayed with format spec F. */
void
tab_value (struct tab_table *table, int c, int r, unsigned char opt,
- const union value *v, const struct fmt_spec *f)
+ const union value *v, const struct dictionary *dict,
+ const struct fmt_spec *f)
{
char *contents;
}
#endif
- contents = data_out_pool (v, "FIXME", f, table->container);
+ contents = data_out_pool (v, dict_get_encoding (dict), f, table->container);
table->cc[c + r * table->cf] = ss_cstr (contents);
table->ct[c + r * table->cf] = opt;
#endif
double_value.f = val;
- s = data_out_pool (&double_value, "FIXME", &f, table->container);
+ s = data_out_pool (&double_value, "FIXME-tab_fixed", &f, table->container);
cp = s;
while (isspace ((unsigned char) *cp) && cp < &s[w])
#endif
double_value.f = val;
- s = data_out_pool (&double_value, "FIXME", fmt, table->container);
+ s = data_out_pool (&double_value, "FIXME-tab_double", fmt, table->container);
cp = s;
while (isspace ((unsigned char) *cp) && cp < s + fmt->w)