[Xfce4-commits] <xfce4-calculator-plugin:master> Set the LC_NUMERIC locale to "C" to make sure the comma sign (", ") isn't treated as a decimal separator.

Erik Edelmann noreply at xfce.org
Tue Jun 29 22:50:05 CEST 2010


Updating branch refs/heads/master
         to b4d7bb412305c41393e2daf4e65413e11d0aed09 (commit)
       from 9ef90edb236cbf1d486cb16e4487ce8f51da68c8 (commit)

commit b4d7bb412305c41393e2daf4e65413e11d0aed09
Author: Erik Edelmann <erik_e at iki.fi>
Date:   Wed Mar 17 00:56:32 2010 +0200

    Set the LC_NUMERIC locale to "C" to make sure the comma sign (",") isn't
    treated as a decimal separator.

 panel-plugin/calculator.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/calculator.c b/panel-plugin/calculator.c
index 200b8b0..021f8d4 100644
--- a/panel-plugin/calculator.c
+++ b/panel-plugin/calculator.c
@@ -23,6 +23,7 @@
 #endif
 
 #include <string.h>
+#include <locale.h>
 #include <gtk/gtk.h>
 #include <libxfce4util/libxfce4util.h>
 #include <libxfcegui4/libxfcegui4.h>
@@ -367,6 +368,9 @@ static void calc_construct(XfcePanelPlugin *plugin)
 {
     CalcPlugin *calc;
 
+    /* Make sure the comma sign (",") isn't treated as a decimal separator. */
+    setlocale(LC_NUMERIC, "C");
+
     xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
 
     calc = calc_new(plugin);



More information about the Xfce4-commits mailing list