[libgda] GdauiNumericEntry: respect the locale
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgda] GdauiNumericEntry: respect the locale
- Date: Wed, 30 Dec 2009 21:25:26 +0000 (UTC)
commit 04e7522f6b8594825c7e7c1260ea75ff6a1f6591
Author: Vivien Malerba <malerba gnome-db org>
Date: Wed Dec 23 14:32:34 2009 +0100
GdauiNumericEntry: respect the locale
libgda-ui/data-entries/gdaui-numeric-entry.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-numeric-entry.c b/libgda-ui/data-entries/gdaui-numeric-entry.c
index 29bbd6b..3de9b57 100644
--- a/libgda-ui/data-entries/gdaui-numeric-entry.c
+++ b/libgda-ui/data-entries/gdaui-numeric-entry.c
@@ -676,15 +676,16 @@ gdaui_numeric_entry_get_value (GdauiNumericEntry *entry)
text = gdaui_entry_get_text ((GdauiEntry*) entry);
if (text) {
- if (entry->priv->thousands_sep) {
- gchar *ptr;
- gint len;
- len = strlen (text);
- for (ptr = text; *ptr; ) {
- if (*ptr == entry->priv->thousands_sep)
- g_memmove (ptr, ptr+1, len - (ptr - text));
- else
- ptr++;
+ gchar *ptr;
+ gint len;
+ len = strlen (text);
+ for (ptr = text; *ptr; ) {
+ if (*ptr == entry->priv->thousands_sep)
+ g_memmove (ptr, ptr+1, len - (ptr - text));
+ else {
+ if (*ptr == entry->priv->decimal_sep)
+ *ptr = '.';
+ ptr++;
}
}
value = gda_value_new_from_string (text, entry->priv->type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]