-typedef int convert_func (char *, const struct fmt_spec *,
- const union value *);
-
-static convert_func convert_F, convert_N, convert_E, convert_F_plus;
-static convert_func convert_Z, convert_A, convert_AHEX, convert_IB;
-static convert_func convert_P, convert_PIB, convert_PIBHEX, convert_PK;
-static convert_func convert_RB, convert_RBHEX, convert_CCx, convert_date;
-static convert_func convert_time, convert_WKDAY, convert_MONTH;
-static convert_func try_F;
-
-/* Converts binary value V into printable form in string S according
- to format specification FP. The string as written has exactly
- FP->W characters. It is not null-terminated. Returns 1 on
- success, 0 on failure. */
-int
-data_out (char *s, const struct fmt_spec *fp, const union value *v)
-{
- union value tmp_val;
-
- {
- int cat = formats[fp->type].cat;
- if ((cat & FCAT_BLANKS_SYSMIS) && v->f == SYSMIS)
- {
- memset (s, ' ', fp->w);
- s[fp->w - fp->d - 1] = '.';
- return 1;
- }
- if ((cat & FCAT_SHIFT_DECIMAL) && v->f != SYSMIS && fp->d)
- {
- tmp_val.f = v->f * pow (10.0, fp->d);
- v = &tmp_val;
- }
- }
-
- {
- static convert_func *const handlers[FMT_NUMBER_OF_FORMATS] =
- {
- convert_F, convert_N, convert_E, convert_F_plus,
- convert_F_plus, convert_F_plus, convert_F_plus,
- convert_Z, convert_A, convert_AHEX, convert_IB, convert_P, convert_PIB,
- convert_PIBHEX, convert_PK, convert_RB, convert_RBHEX,
- convert_CCx, convert_CCx, convert_CCx, convert_CCx, convert_CCx,
- convert_date, convert_date, convert_date, convert_date, convert_date,
- convert_date, convert_date, convert_date, convert_date,
- convert_time, convert_time,
- convert_WKDAY, convert_MONTH,
- };
-
- return handlers[fp->type] (s, fp, v);
- }
-}
+typedef int numeric_converter (char *, const struct fmt_spec *, double);
+static numeric_converter convert_F, convert_N, convert_E, convert_F_plus;
+static numeric_converter convert_Z, convert_IB, convert_P, convert_PIB;
+static numeric_converter convert_PIBHEX, convert_PK, convert_RB;
+static numeric_converter convert_RBHEX, convert_CCx, convert_date;
+static numeric_converter convert_time, convert_WKDAY, convert_MONTH;