Commit 4a112f1e authored by Morten Welinder's avatar Morten Welinder

GUI: Use shortest round-tripping versions for constants in formulae.

parent 368545ab
2016-08-21 Morten Welinder <terra@gnome.org>
* src/value.c (value_get_as_gstring): Let a negative
decimal_digits mean "shortest round-tripping string".
2016-08-20 Morten Welinder <terra@gnome.org>
* configure.ac: Post-release bump.
......
......@@ -1475,7 +1475,7 @@ gnm_conventions_new_full (unsigned size)
convs->input.func = std_func_map;
convs->input.external_wb = std_external_wb;
convs->output.decimal_digits = GNM_DIG;
convs->output.decimal_digits = -1;
convs->output.translated = TRUE;
convs->output.string = std_output_string;
convs->output.name = std_expr_name_handler;
......
......@@ -924,9 +924,12 @@ value_get_as_gstring (GnmValue const *v, GString *target,
return;
case VALUE_FLOAT:
g_string_append_printf (target, "%.*" GNM_FORMAT_g,
conv->output.decimal_digits,
v->v_float.val);
if (conv->output.decimal_digits < 0)
go_dtoa (target, "!" GNM_FORMAT_g, v->v_float.val);
else
g_string_append_printf (target, "%.*" GNM_FORMAT_g,
conv->output.decimal_digits,
v->v_float.val);
return;
case VALUE_ARRAY: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment