From: Ben Pfaff Date: Sun, 10 Dec 2006 04:04:38 +0000 (+0000) Subject: * format.c (fmt_dollar_template): Use user's decimal point X-Git-Tag: v0.6.0~654 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf2b8455da9e0ae5359740dcb6ad2037046f88e7;p=pspp-builds.git * format.c (fmt_dollar_template): Use user's decimal point character. Add assertion. --- diff --git a/src/data/ChangeLog b/src/data/ChangeLog index 44cd03ee..4f72a217 100644 --- a/src/data/ChangeLog +++ b/src/data/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 9 20:04:22 2006 Ben Pfaff + + * format.c (fmt_dollar_template): Use user's decimal point + character. Add assertion. + Sat Dec 9 20:02:25 2006 Ben Pfaff * format.c (fmt_dollar_template): New function, based on diff --git a/src/data/format.c b/src/data/format.c index e2b163a5..fef7c1c3 100644 --- a/src/data/format.c +++ b/src/data/format.c @@ -597,6 +597,8 @@ fmt_dollar_template (const struct fmt_spec *fmt) struct string s = DS_EMPTY_INITIALIZER; int c; + assert (fmt->type == FMT_DOLLAR); + ds_put_char (&s, '$'); for (c = MAX (fmt->w - fmt->d - 1, 0); c > 0; ) { @@ -609,7 +611,7 @@ fmt_dollar_template (const struct fmt_spec *fmt) } if (fmt->d > 0) { - ds_put_char (&s, '.'); + ds_put_char (&s, fmt_decimal_char (fmt->type)); ds_put_char_multiple (&s, '#', fmt->d); }