aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Conover <rconover@zootweb.com>2001-02-19 07:31:27 +0800
committerRusty Conover <rconover@src.gnome.org>2001-02-19 07:31:27 +0800
commitcf479fb7dc38275fe862be49d31d9fc58cc9fa6f (patch)
tree148fe1cf40a8402abceb3884e2ee06edddc1bd11
parent3d8953cbd9a23ba13300afe65afa3d98a1a3b521 (diff)
downloadgsoc2013-evolution-cf479fb7dc38275fe862be49d31d9fc58cc9fa6f.tar.gz
gsoc2013-evolution-cf479fb7dc38275fe862be49d31d9fc58cc9fa6f.tar.zst
gsoc2013-evolution-cf479fb7dc38275fe862be49d31d9fc58cc9fa6f.zip
Fix it so that numbers containing inner zeros will be formatted correctly.
2001-02-18 Rusty Conover <rconover@zootweb.com> * gal/util/e-util.c (e_format_number): Fix it so that numbers containing inner zeros will be formatted correctly. For instance the number 5005 when formatted was coming out as 5,5. It now comes out at 5,005. svn path=/trunk/; revision=8272
-rw-r--r--e-util/e-util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index e542574d58..02092041f0 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -627,9 +627,11 @@ 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) {
@@ -638,7 +640,11 @@ e_format_number (gint number)
grouping++;
case 0:
divider = epow10(last_count);
- group = g_strdup_printf("%d", number % divider);
+ if(!list && (number/divider) > 0) {
+ group = g_strdup_printf("%0*d", initial_grouping, number % divider);
+ } else {
+ group = g_strdup_printf("%d", number % divider);
+ }
number /= divider;
break;
case CHAR_MAX: