aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-12 02:08:54 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-12 02:08:54 +0800
commita035cd8f338c2e7541389c6eb5ed0356dd68a603 (patch)
treeef86b5dec519f808a57cac22baa369ea9fa29af0 /e-util/e-util.c
parent5e23b58d82c3f8d5b9dea62723fac8dbce15ed6a (diff)
downloadgsoc2013-evolution-a035cd8f338c2e7541389c6eb5ed0356dd68a603.tar.gz
gsoc2013-evolution-a035cd8f338c2e7541389c6eb5ed0356dd68a603.tar.zst
gsoc2013-evolution-a035cd8f338c2e7541389c6eb5ed0356dd68a603.zip
Based on patches from Fredrik Nilsson <jymdman@home.se>.
2001-10-11 Christopher James Lahey <clahey@ximian.com> Based on patches from Fredrik Nilsson <jymdman@home.se>. * gal/util/e-util.c (e_format_number): Made this work properly for numbers with a full set of 0s for one of the grouping elements. svn path=/trunk/; revision=13586
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index b8fab82b25..b209aa7dde 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -858,11 +858,9 @@ e_format_number (gint number)
int divider;
char *value;
char *value_iterator;
- int initial_grouping;
locality = localeconv();
grouping = locality->grouping;
- initial_grouping = *grouping;
while (number) {
char *group;
switch (*grouping) {
@@ -871,8 +869,8 @@ e_format_number (gint number)
grouping++;
case 0:
divider = epow10(last_count);
- if((!list && (number/divider) > 0) || number > divider) {
- group = g_strdup_printf("%0*d", initial_grouping, number % divider);
+ if (number >= divider) {
+ group = g_strdup_printf("%0*d", last_count, number % divider);
} else {
group = g_strdup_printf("%d", number % divider);
}