Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ef4a163

Browse files
author
Hiroshi Inoue
committed
1) Fit the precision of floating point to that of server side
(fix by Hiroki kataoka). 2) Ensure the definition of atof()(#include stdlib.h). (suggestion by Masaaki Sakaida).
1 parent f7f0b17 commit ef4a163

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/interfaces/odbc/convert.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
#include <time.h>
4444
#include <math.h>
45+
#include <stdlib.h>
4546
#include "convert.h"
4647
#include "statement.h"
4748
#include "qresult.h"
@@ -892,12 +893,12 @@ copy_statement_with_parameters(StatementClass *stmt)
892893
break;
893894

894895
case SQL_C_DOUBLE:
895-
sprintf(param_string, "%f",
896+
sprintf(param_string, "%15g",
896897
*((SDOUBLE *) buffer));
897898
break;
898899

899900
case SQL_C_FLOAT:
900-
sprintf(param_string, "%f",
901+
sprintf(param_string, "%6g",
901902
*((SFLOAT *) buffer));
902903
break;
903904

0 commit comments

Comments
 (0)