+ struct fmt_number_style *style = &settings->styles[type];
+
+ assert (grouping == '.' || grouping == ',' || grouping == 0);
+ assert (decimal == '.' || decimal == ',');
+ assert (decimal != grouping);
+
+ fmt_number_style_destroy (style);
+
+ fmt_affix_set (&style->neg_prefix, neg_prefix);
+ fmt_affix_set (&style->prefix, prefix);
+ fmt_affix_set (&style->suffix, suffix);
+ fmt_affix_set (&style->neg_suffix, neg_suffix);
+ style->decimal = decimal;
+ style->grouping = grouping;
+}
+
+/* Sets the decimal point character for the settings in S to DECIMAL.
+
+ This has no effect on custom currency formats. */
+void
+fmt_settings_set_decimal (struct fmt_settings *s, char decimal)
+{
+ int grouping = decimal == '.' ? ',' : '.';
+ assert (decimal == '.' || decimal == ',');
+
+ fmt_settings_set_style (s, FMT_F, decimal, 0, "-", "", "", "");
+ fmt_settings_set_style (s, FMT_E, decimal, 0, "-", "", "", "");
+ fmt_settings_set_style (s, FMT_COMMA, decimal, grouping, "-", "", "", "");
+ fmt_settings_set_style (s, FMT_DOT, grouping, decimal, "-", "", "", "");
+ fmt_settings_set_style (s, FMT_DOLLAR, decimal, grouping, "-", "$", "", "");
+ fmt_settings_set_style (s, FMT_PCT, decimal, 0, "-", "", "%", "");