/* Format of reals in output (SET WRB). */
enum float_format output_float_format;
+ /* MATRIX...END MATRIX settings. */
+ enum settings_mdisplay mdisplay;
+
int viewlength;
int viewwidth;
bool safer_mode;
struct fmt_spec default_format;
bool testing_mode;
int fuzzbits;
+ int scalemin;
int cmd_algorithm;
int global_algorithm;
.input_float_format = FLOAT_NATIVE_DOUBLE,
.output_integer_format = INTEGER_NATIVE,
.output_float_format = FLOAT_NATIVE_DOUBLE,
+ .mdisplay = SETTINGS_MDISPLAY_TEXT,
.viewlength = 24,
.viewwidth = 79,
.safer_mode = false,
.default_format = { .type = FMT_F, .w = 8, .d = 2 },
.testing_mode = false,
.fuzzbits = 6,
+ .scalemin = 24,
.cmd_algorithm = ENHANCED,
.global_algorithm = ENHANCED,
.syntax = ENHANCED,
the_settings.fuzzbits = fuzzbits;
}
+int
+settings_get_scalemin (void)
+{
+ return the_settings.scalemin;
+}
+
+void
+settings_set_scalemin (int scalemin)
+{
+ the_settings.scalemin = scalemin;
+}
+
/* Return the current algorithm setting */
enum behavior_mode
settings_get_algorithm (void)
}
\f
-/* Sets custom currency specifier CC having name CC_NAME ('A' through
- 'E') to correspond to the settings in CC_STRING. */
-bool
+/* Sets custom currency specifier CC having name CC_NAME ('A' through 'E') to
+ correspond to the settings in CC_STRING. Returns NULL if successful,
+ otherwise an error message that the caller must free. */
+char * WARN_UNUSED_RESULT
settings_set_cc (const char *cc_string, enum fmt_type type)
{
struct fmt_number_style *style = fmt_number_style_from_string (cc_string);
if (!style)
- {
- msg (SE, _("%s: Custom currency string `%s' does not contain "
- "exactly three periods or commas (or it contains both)."),
- fmt_name (type), cc_string);
- return false;
- }
+ return xasprintf (_("Custom currency string `%s' for %s does not contain "
+ "exactly three periods or commas (or it contains "
+ "both)."),
+ fmt_name (type), cc_string);
fmt_settings_set_cc (&the_settings.styles, type, style);
- return true;
+ return NULL;
}
void
the_settings.styles.decimal = decimal;
}
+void
+settings_set_include_leading_zero (bool include_leading_zero)
+{
+ the_settings.styles.include_leading_zero = include_leading_zero;
+}
+
const struct fmt_settings *
settings_get_fmt_settings (void)
{
{
the_settings.show_variables = s;
}
+
+enum settings_mdisplay
+settings_get_mdisplay (void)
+{
+ return the_settings.mdisplay;
+}
+
+void
+settings_set_mdisplay (enum settings_mdisplay mdisplay)
+{
+ the_settings.mdisplay = mdisplay;
+}