]> granicus.if.org Git - postgresql/commitdiff
1) Fit the precision of floating point to that of server side
authorHiroshi Inoue <inoue@tpf.co.jp>
Fri, 6 Apr 2001 09:23:44 +0000 (09:23 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Fri, 6 Apr 2001 09:23:44 +0000 (09:23 +0000)
   (fix by Hiroki kataoka).
2) Ensure the definition of atof()(#include stdlib.h).
  (suggestion by Masaaki Sakaida).

src/interfaces/odbc/convert.c

index 2dca3edfa1287cd6c9dcf14dcbc0ad983501cc55..1b56c5df8873bdd15ebba316316ba2068d48b510 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <time.h>
 #include <math.h>
+#include <stdlib.h>
 #include "convert.h"
 #include "statement.h"
 #include "qresult.h"
@@ -892,12 +893,12 @@ copy_statement_with_parameters(StatementClass *stmt)
                                break;
 
                        case SQL_C_DOUBLE:
-                               sprintf(param_string, "%f",
+                               sprintf(param_string, "%15g",
                                                *((SDOUBLE *) buffer));
                                break;
 
                        case SQL_C_FLOAT:
-                               sprintf(param_string, "%f",
+                               sprintf(param_string, "%6g",
                                                *((SFLOAT *) buffer));
                                break;