Commit 1a192e53 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Use GNUM_FORMAT_G. The days of glib <1.2.9 are over. (fmt_general_int):

2005-01-04  Morten Welinder  <terra@gnome.org>

	* src/format.c (fmt_general_float): Use GNUM_FORMAT_G.  The days
	of glib <1.2.9 are over.
	(fmt_general_int): Ditto.

	* src/numbers.h (GNUM_FORMAT_G): Add.
parent 34636688
2005-01-04 Morten Welinder <terra@gnome.org>
* src/format.c (fmt_general_float): Use GNUM_FORMAT_G. The days
of glib <1.2.9 are over.
(fmt_general_int): Ditto.
* src/numbers.h (GNUM_FORMAT_G): Add.
* src/wbcg-actions.c: Fix Help->Contents and Edit->Clear->Contents
accelerators.
......
......@@ -38,6 +38,7 @@ Morten:
* Vastly improve sorting speed for large ranges with formulas.
[#161909]
* Fix Help->Contents accelerator. [#162865]
* Make general format use "E", not "e", as appropriate.
--------------------------------------------------------------------------
Gnumeric 1.4.1
......
2005-01-04 Morten Welinder <terra@gnome.org>
* src/format.c (fmt_general_float): Use GNUM_FORMAT_G. The days
of glib <1.2.9 are over.
(fmt_general_int): Ditto.
* src/numbers.h (GNUM_FORMAT_G): Add.
* src/wbcg-actions.c: Fix Help->Contents and Edit->Clear->Contents
accelerators.
......
......@@ -1966,8 +1966,7 @@ fmt_general_float (GString *result, gnm_float val, double col_width)
else if (prec > GNUM_DIG)
prec = GNUM_DIG;
/* FIXME : glib bug. it does not handle G, use g (fixed in 1.2.9) */
g_string_append_printf (result, "%.*" GNUM_FORMAT_g, prec, val);
g_string_append_printf (result, "%.*" GNUM_FORMAT_G, prec, val);
}
/**
......@@ -1991,9 +1990,8 @@ fmt_general_int (GString *result, int val, int col_width)
/* Switch to scientific notation if things are too wide */
if (log_val > col_width) {
/* FIXME : glib bug. it does not handle G, use g */
/* Decrease available width by 5 to account for .+E00 */
g_string_append_printf (result, "%.*g", col_width - 5, (double)val);
g_string_append_printf (result, "%.*G", col_width - 5, (double)val);
return;
}
}
......
......@@ -109,6 +109,7 @@ gnm_float yngnum (int n, gnm_float x);
#define GNUM_FORMAT_E "LE"
#define GNUM_FORMAT_f "Lf"
#define GNUM_FORMAT_g "Lg"
#define GNUM_FORMAT_G "LG"
#define GNUM_DIG LDBL_DIG
#define GNUM_MANT_DIG LDBL_MANT_DIG
#define GNUM_MIN_EXP LDBL_MIN_EXP
......@@ -202,6 +203,7 @@ gnm_float atanh (gnm_float x);
#define GNUM_FORMAT_E "E"
#define GNUM_FORMAT_f "f"
#define GNUM_FORMAT_g "g"
#define GNUM_FORMAT_G "G"
#define GNUM_DIG DBL_DIG
#define GNUM_MANT_DIG DBL_MANT_DIG
#define GNUM_MIN_EXP DBL_MIN_EXP
......
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