-
-/* Sets the number style for TYPE to have the given standard
- PREFIX and SUFFIX, "-" as prefix suffix, an empty negative
- suffix, DECIMAL as the decimal point character, and GROUPING
- as the grouping character. */
-static void
-set_style (struct fmt_number_style *styles, enum fmt_type type,
- const char *prefix, const char *suffix,
- char decimal, char grouping)
-{
- struct fmt_number_style *style;
-
- assert (is_fmt_type (type));
-
- style = &styles[type] ;
-
- fmt_number_style_destroy (style);
-
- ss_alloc_substring (&style->neg_prefix, ss_cstr ("-"));
- ss_alloc_substring (&style->prefix, ss_cstr (prefix));
- ss_alloc_substring (&style->suffix, ss_cstr (suffix));
- style->decimal = decimal;
- style->grouping = grouping;
-}
-
-/* Sets the decimal point character to DECIMAL. */
-void
-fmt_set_decimal (struct fmt_number_style *styles, char decimal)
-{
- int grouping = decimal == '.' ? ',' : '.';
- assert (decimal == '.' || decimal == ',');
-
- set_style (styles, FMT_F, "", "", decimal, 0);
- set_style (styles, FMT_E, "", "", decimal, 0);
- set_style (styles, FMT_COMMA, "", "", decimal, grouping);
- set_style (styles, FMT_DOT, "", "", grouping, decimal);
- set_style (styles, FMT_DOLLAR, "$", "", decimal, grouping);
- set_style (styles, FMT_PCT, "", "%", decimal, 0);
-}
-\f