Commit 502797c7 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Use the scale factor. (format_number) : init the scale factor when a fmt


2002-10-08  Jody Goldberg <jody@gnome.org>

	* src/format.c (do_render_number) : Use the scale factor.
	(format_number) : init the scale factor when a fmt ends a section with
	  a comma.
parent dab2d15a
2002-10-08 Jody Goldberg <jody@gnome.org>
* src/format.c (do_render_number) : Use the scale factor.
(format_number) : init the scale factor when a fmt ends a section with
a comma.
2002-10-08 Morten Welinder <terra@diku.dk>
* src/workbook-view.c (wb_view_new_from_file): Catch invalid file
......
Gnumeric 1.1.11
Morten:
* Start handling invalid (== non-utf8) file names.
--------------------------------------------------------------------------
Gnumeric 1.1.10
Andreas:
......@@ -35,6 +29,7 @@ Jody:
* Remove implicit conversion of unquoted strings that are not names
* Import named expressions, arrays and merged regions from OpenCalc
* More cleanup after the big parser rework
* Esoteric XL number formats #,,##0,,
Morten:
* Port search center from gal's e-table to gtk's treeview.
......@@ -42,6 +37,7 @@ Morten:
* Reduce the number of source places that need to be changed in
order to get more than 256 columns and/or 65536 rows.
* Fix --geometry, I hope.
* Start handling invalid (== non-utf8) file names.
dorami@bu.iij4u.or.jp:
* Add InputMethod support for better international key support
......
2002-10-08 Jody Goldberg <jody@gnome.org>
* src/format.c (do_render_number) : Use the scale factor.
(format_number) : init the scale factor when a fmt ends a section with
a comma.
2002-10-08 Morten Welinder <terra@diku.dk>
* src/workbook-view.c (wb_view_new_from_file): Catch invalid file
......
2002-10-08 Jody Goldberg <jody@gnome.org>
* src/format.c (do_render_number) : Use the scale factor.
(format_number) : init the scale factor when a fmt ends a section with
a comma.
2002-10-08 Morten Welinder <terra@diku.dk>
* src/workbook-view.c (wb_view_new_from_file): Catch invalid file
......
......@@ -780,7 +780,7 @@ do_render_number (gnum_float number, format_info_t *info, GString *result)
decimal_point);
#endif
render_number (result, number, info);
render_number (result, info->scale * number, info);
}
/*
......@@ -1005,6 +1005,7 @@ format_number (gnum_float number, int col_width, StyleFormatEntry const *entry)
number = -number;
}
info.has_fraction = entry->has_fraction;
info.scale = 1;
while (*format) {
int c = *format;
......@@ -1064,14 +1065,19 @@ format_number (gnum_float number, int col_width, StyleFormatEntry const *entry)
break;
}
case ',': {
if (!can_render_number) {
char const sep = format_get_thousand ();
g_string_append_c (result, sep);
} else
case ',':
if (can_render_number) {
guchar const *tmp = format;
while (*++tmp == ',')
;
if (*tmp == '\0' || *tmp == '.' || *tmp == ';')
/* NOTE : format-tmp is NEGATIVE */
info.scale = gpow10 (3*(format-tmp));
info.group_thousands = TRUE;
format = tmp-1;
} else
g_string_append_c (result, format_get_thousand ());
break;
}
/* FIXME: this is a gross hack */
case 'E': case 'e': {
......
......@@ -47,6 +47,7 @@ char *format_remove_decimal (StyleFormat const *fmt);
typedef struct {
int right_optional, right_spaces, right_req, right_allowed;
int left_spaces, left_req;
float scale;
gboolean rendered;
gboolean negative;
gboolean decimal_separator_seen;
......
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