[gcalctool] If a thousands separator is not defined then use ' ' (Bug #632182)



commit b3cf5402c19586665fdb3bd834e3d66edc637586
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Oct 20 20:29:34 2010 +1100

    If a thousands separator is not defined then use ' ' (Bug #632182)

 NEWS                |    1 +
 src/mp-serializer.c |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index e0334c1..dae040d 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Overview of changes in gcalctool 5.91.2
     * Use icons for undo and clear buttons as the translations cause them to be
       oversized in some languages
     * Handle Han digits (ã??ã?¡ã?¢ã?£ã?¤ã?¥ã?¦ã?§ã?¨ã?©)
+    * If a thousands separator is not defined then use ' ' (Bug #632182)
 
 Overview of changes in gcalctool 5.91.1
 
diff --git a/src/mp-serializer.c b/src/mp-serializer.c
index 4b09971..a5d8c2e 100644
--- a/src/mp-serializer.c
+++ b/src/mp-serializer.c
@@ -514,7 +514,10 @@ mp_serializer_init(MpSerializer *serializer)
     radix = nl_langinfo(RADIXCHAR);
     serializer->priv->radix = radix ? g_utf8_get_char(g_locale_to_utf8(radix, -1, NULL, NULL, NULL)) : '.';
     tsep = nl_langinfo(THOUSEP);
-    serializer->priv->tsep = tsep ? g_utf8_get_char(g_locale_to_utf8(tsep, -1, NULL, NULL, NULL)) : ',';
+    if (tsep && tsep[0] != '\0')
+        serializer->priv->tsep = g_utf8_get_char(g_locale_to_utf8(tsep, -1, NULL, NULL, NULL));
+    else
+        serializer->priv->tsep = ' ';
     serializer->priv->tsep_count = 3;
 
     serializer->priv->base = 10;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]