- struct resize_datum_aux *aux = aux_;
-
- if (aux->new_width == 0)
- {
- /* FIXME: try to parse string as number. */
- new->f = SYSMIS;
- }
- else if (aux->old_width == 0)
- {
- /* FIXME: format number as string. */
- value_set_missing (new, aux->new_width);
- }
- else
- value_copy_rpad (new, aux->new_width, old, aux->old_width, ' ');
+ const struct resize_datum_aux *aux = aux_;
+ int new_width = var_get_width (aux->new_variable);
+ const char *enc = dict_get_encoding (aux->dict);
+ const struct fmt_spec *newfmt = var_get_print_format (aux->new_variable);
+ char *s = data_out (old, enc, var_get_print_format (aux->old_variable));
+ enum fmt_type type = (fmt_usable_for_input (newfmt->type)
+ ? newfmt->type
+ : FMT_DOLLAR);
+ free (data_in (ss_cstr (s), enc, type, new, new_width, enc));
+ free (s);