Original code used float8out(), but the resulting exponential notation
was not handled (e.g. '3E9' was decoded as '3').
*
* 1998 Jan Wieck
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.11 1999/03/14 16:49:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.12 1999/05/04 15:50:24 thomas Exp $
*
* ----------
*/
{
Numeric res;
NumericVar result;
- char *tmp;
+ char buf[512];
if (val == NULL)
return NULL;
init_var(&result);
- tmp = float8out(val);
- set_var_from_str(tmp, &result);
+ sprintf(buf, "%f", *val);
+ set_var_from_str(buf, &result);
res = make_result(&result);
free_var(&result);
- pfree(tmp);
return res;
}