aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-11-08 06:04:53 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-11-08 06:04:53 +0800
commitd6445f8abfa78c0a9c8680a3ba7422d331391f8f (patch)
tree8d462e7747bccdc2108837401fd295dfa160943d /e-util/e-util.c
parent6140798719beb44abaa4de89043f6d911c977621 (diff)
downloadgsoc2013-evolution-d6445f8abfa78c0a9c8680a3ba7422d331391f8f.tar.gz
gsoc2013-evolution-d6445f8abfa78c0a9c8680a3ba7422d331391f8f.tar.zst
gsoc2013-evolution-d6445f8abfa78c0a9c8680a3ba7422d331391f8f.zip
Merge revisions 36685:36729 from trunk.
svn path=/branches/kill-bonobo/; revision=36763
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 2e46128a5a..adfd7bf807 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -390,94 +390,6 @@ e_format_number (gint number)
}
}
-static gchar *
-do_format_number_as_float (gdouble number)
-{
- GList *iterator, *list = NULL;
- struct lconv *locality;
- gint char_length = 0;
- gint group_count = 0;
- gchar *grouping;
- gint last_count = 3;
- gint divider;
- gchar *value;
- gchar *value_iterator;
- gdouble fractional;
-
- locality = localeconv();
- grouping = locality->grouping;
- while (number >= 1.0) {
- gchar *group;
- switch (*grouping) {
- default:
- last_count = *grouping;
- grouping++;
- /* Fall through */
- case 0:
- divider = epow10(last_count);
- number /= divider;
- fractional = modf (number, &number);
- fractional *= divider;
- fractional = floor (fractional);
-
- if (number >= 1.0) {
- group = g_strdup_printf("%0*d", last_count, (int) fractional);
- } else {
- group = g_strdup_printf("%d", (gint) fractional);
- }
- break;
- case CHAR_MAX:
- divider = epow10(last_count);
- number /= divider;
- fractional = modf (number, &number);
- fractional *= divider;
- fractional = floor (fractional);
-
- while (number >= 1.0) {
- group = g_strdup_printf("%0*d", last_count, (gint) fractional);
-
- char_length += strlen(group);
- list = g_list_prepend(list, group);
- group_count ++;
-
- divider = epow10(last_count);
- number /= divider;
- fractional = modf (number, &number);
- fractional *= divider;
- fractional = floor (fractional);
- }
-
- group = g_strdup_printf("%d", (gint) fractional);
- break;
- }
- char_length += strlen(group);
- list = g_list_prepend(list, group);
- group_count ++;
- }
-
- if (list) {
- value = g_new(gchar, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep));
-
- iterator = list;
- value_iterator = value;
-
- strcpy(value_iterator, iterator->data);
- value_iterator += strlen(iterator->data);
- for (iterator = iterator->next; iterator; iterator = iterator->next) {
- strcpy(value_iterator, locality->thousands_sep);
- value_iterator += strlen(locality->thousands_sep);
-
- strcpy(value_iterator, iterator->data);
- value_iterator += strlen(iterator->data);
- }
- g_list_foreach (list, (GFunc) g_free, NULL);
- g_list_free (list);
- return value;
- } else {
- return g_strdup("0");
- }
-}
-
/* Perform a binary search for key in base which has nmemb elements
of size bytes each. The comparisons are done by (*compare)(). */
void