[libgda/LIBGDA_5.0] GValue to string now use GdaNumeric API



commit bef987a11aa58e50442603e65efe928f3bbde74a
Author: Daniel Espinosa <despinosa src gnome org>
Date:   Sun Jan 22 09:56:13 2012 -0600

    GValue to string now use GdaNumeric API

 libgda/gda-value.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index 32ace66..64fb814 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -201,13 +201,10 @@ set_from_string (GValue *value, const gchar *as_string)
 		}
 	}
 	else if (type == GDA_TYPE_NUMERIC) {
-		GdaNumeric numeric;
-		/* FIXME: what test whould i do for numeric? Use GMP (http://gmplib.org/) ?*/
-		numeric.number = g_strdup (as_string);
-		numeric.precision = 0; /* FIXME */
-		numeric.width = 0; /* FIXME */
+		GdaNumeric *numeric = gda_numeric_new ();
+		gda_numeric_set_from_string (as_string);
 		gda_value_set_numeric (value, &numeric);
-		g_free (numeric.number);
+		gda_numeric_free (numeric);
 		retval = TRUE;
 	}
 	else if (type == G_TYPE_DATE) {



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