Thanks a lot for every reply. The num is just random num. The project is on power-measurement. So there are some big nums with high precision.
May I use sqlite3_bind_double() and sqlite3_prepare_v2() to solve the problem. liubin liu wrote: > > Now I use the sqlite3_mprintf() and the "%f" to get the double num. My > code is below. > > Now there is a num like "212345678901234567890123456.988290112". With the > way of "sqlite3_mprintf()" and "%f", the num is cut to > "212345678901234600000000000.000000". > > > How to input the num "212345678901234567890123456.988290112"? > > > code_________________________________________________ > > ... > char *query_format = "INSERT OR REPLACE INTO pow_value_st (id, valid, > powervalue_1, powervalue_2) VALUES (%d, %d, %f, %f)"; > char *query_string = NULL; > query_string = sqlite3_mprintf (query_format, index, tc->valid, > tc->powervalue[0], tc->powervalue[1]); > printf ("%s\n", query_string); > ... > > > > PS: > the columns of powervalue_1 and powervalue_2 are defined as DOUBLE type: > CREATE TABLE pow_value_st (id INTEGER PRIMARY KEY, valid CHAR(1), > powervalue_1 DOUBLE, powervalue_2 DOUBLE ); > -- View this message in context: http://www.nabble.com/How-to-input-a-double-num--tp26105457p26123863.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users