[libgda] Fixes on latest GdaNumeric commits.
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Fixes on latest GdaNumeric commits.
- Date: Sun, 22 Jan 2012 17:05:56 +0000 (UTC)
commit 5284d7f4757f5670d18aca06baf2f8493192e7ba
Author: Daniel Espinosa <despinosa src gnome org>
Date: Sun Jan 22 11:04:12 2012 -0600
Fixes on latest GdaNumeric commits.
* Fix commit c0bab6b8f11f48a1d87edca2ae822642d7e8581d
* Fix commit 5dd485e5e17b83214091ded9d9a262c8f1468c69
libgda/Gda-5.0.gir | 3 ++-
libgda/gda-value.c | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libgda/Gda-5.0.gir b/libgda/Gda-5.0.gir
index 9279c6b..47f6fdc 100644
--- a/libgda/Gda-5.0.gir
+++ b/libgda/Gda-5.0.gir
@@ -11779,7 +11779,8 @@ Free-function: gda_numeric_free</doc>
</method>
<method name="set_from_string"
c:identifier="gda_numeric_set_from_string">
- <doc xml:whitespace="preserve">Sets @numeric with a number represented by @str.
+ <doc xml:whitespace="preserve">Sets @numeric with a number represented by @str. By default converts @str to
+#gdouble.
* Since: 5.0.2</doc>
<return-value transfer-ownership="none">
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index c4244bd..9812ddb 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -202,7 +202,7 @@ set_from_string (GValue *value, const gchar *as_string)
}
else if (type == GDA_TYPE_NUMERIC) {
GdaNumeric *numeric = gda_numeric_new ();
- gda_numeric_set_from_string (as_string);
+ gda_numeric_set_from_string (numeric, as_string);
gda_value_set_numeric (value, &numeric);
gda_numeric_free (numeric);
retval = TRUE;
@@ -905,7 +905,7 @@ gda_numeric_new (void)
{
GdaNumeric *n = g_new0 (GdaNumeric, 1);
setlocale (LC_NUMERIC, "C");
- numeric->number = g_strdup_printf ("%lf", 0.0);
+ n->number = g_strdup_printf ("%lf", 0.0);
setlocale (LC_NUMERIC, gda_numeric_locale);
}
@@ -927,7 +927,7 @@ gda_numeric_set_from_string (GdaNumeric *numeric, const gchar* str)
if (numeric->number)
g_free (numeric->number);
// FIXME: By default convert string to gdouble, for other number types we need to check string format
- gdouble n = g_strtod (str);
+ gdouble n = g_strtod (str, NULL);
setlocale (LC_NUMERIC, "C");
numeric->number = g_strdup_printf ("%lf", n);
setlocale (LC_NUMERIC, gda_numeric_locale);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]