[grisbi-cvs] [SCM] grisbi branch, pbiava_gsb_real_gint64, updated. upstream_version_0_7_3-83-gcac7859

Pierre Biava nobody at users.sourceforge.net
Sun Oct 17 17:09:53 CEST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, pbiava_gsb_real_gint64 has been updated
       via  cac7859390d17bec0ec6e2f91f5b390f54348c35 (commit)
       via  d18839783534cae63747b9e83a050538c640a336 (commit)
       via  9110f5b0972acf5ce6e2542dc1cf923544f12391 (commit)
      from  ca21ee864bae127192523d38e2af43b6680edf9e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cac7859390d17bec0ec6e2f91f5b390f54348c35
Merge: d18839783534cae63747b9e83a050538c640a336 9110f5b0972acf5ce6e2542dc1cf923544f12391
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Oct 17 17:08:49 2010 +0200

    Merge branch 'master' into pbiava_gsb_real_gint64

commit d18839783534cae63747b9e83a050538c640a336
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Oct 17 16:08:56 2010 +0200

    optimizes the loop shaping of numbers

-----------------------------------------------------------------------

Changes:
diff --git a/src/go-optionmenu.c b/src/go-optionmenu.c
index e71a633..ba5fef6 100644
--- a/src/go-optionmenu.c
+++ b/src/go-optionmenu.c
@@ -34,7 +34,10 @@
 
 /*START_INCLUDE*/
 #include "go-optionmenu.h"
-#include "include.h"
+#include <gtk/gtkmenu.h>
+#include <gtk/gtkmenuitem.h>
+#include <gtk/gtkcheckmenuitem.h>
+#include <gdk/gdkkeysyms.h>
 /*END_INCLUDE*/
 
 /*START_STATIC*/
@@ -101,13 +104,6 @@ extern GtkWidget *window;
 /*END_EXTERN*/
 
 
-#include "go-optionmenu.h"
-
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <gdk/gdkkeysyms.h>
-
 static void go_option_menu_class_init      (GOOptionMenuClass *klass);
 static void go_option_menu_init            (GOOptionMenu      *option_menu);
 static void go_option_menu_destroy         (GtkObject          *object);
diff --git a/src/gsb_real.c b/src/gsb_real.c
index bd4466c..6471e16 100644
--- a/src/gsb_real.c
+++ b/src/gsb_real.c
@@ -139,7 +139,6 @@ gchar *gsb_real_raw_format_string (gsb_real number,
     gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
     gchar format[40];
     gchar *result = NULL;
-    gchar *mon_thousands_sep;
 	const gchar *cs_start;
     const gchar *cs_start_space;
     const gchar *sign;
@@ -155,13 +154,22 @@ gchar *gsb_real_raw_format_string (gsb_real number,
     mon_decimal_point = conv->mon_decimal_point && *conv->mon_decimal_point ? conv->mon_decimal_point : ".";
     cs_end_space = (currency_symbol && !conv->p_cs_precedes && conv->p_sep_by_space) ? " " : "";
     cs_end = (currency_symbol && !conv->p_cs_precedes) ? currency_symbol : "";
-    mon_thousands_sep = g_locale_to_utf8 ( conv->mon_thousands_sep, -1, NULL, NULL, NULL );
-
+    
     units = lldiv ( llabs (number.mantissa), gsb_real_power_10[number.exponent] );
 
     nbre_char = g_sprintf ( buffer, "%.0f", (gdouble) units.quot );
 
-    result = gsb_real_add_thousands_sep ( g_strndup ( buffer, nbre_char ), mon_thousands_sep );
+    result = g_strndup ( buffer, nbre_char );
+
+    if ( units.quot >= 1000 )
+    {
+        gchar *mon_thousands_sep;
+
+        mon_thousands_sep = g_locale_to_utf8 ( conv->mon_thousands_sep, -1, NULL, NULL, NULL );
+        result = gsb_real_add_thousands_sep ( result, mon_thousands_sep );
+
+        g_free ( mon_thousands_sep );
+    }
 
     g_snprintf ( format, sizeof ( format ), "%s%d%s",
                                             "%s%s%s%s%s%0",
@@ -178,7 +186,6 @@ gchar *gsb_real_raw_format_string (gsb_real number,
                             cs_end_space,
                             cs_end );
 
-    g_free ( mon_thousands_sep );
 
     return result;
 }


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list