When i insert value into table row (data type float), smt rounds decimal values into zeros. Here is the dramatically simplified code in order to see the situation.Interestingly, assigning a single array value into a variable (as usual) doesn't work here !
Is this a SQLite bug ??
sheennave
0
Light Poster
Recommended Answers
Jump to Post>>Is this a SQLite bug ??
No -- it is a bug in your program.
>>VALUES ('greyfurt', '"+Weight+"' , '"+arraySource_energy_kcal[0]+"' ) ";
Do not put quotes around the floats -- the quotes are only for the strings. You will have to format the query before sending it …
Jump to PostI realize you are using CLR/C++, but here is a c++ program that works ok with floats.
#include <iostream> #include <string> #include "sqlite3.h" // Delete this pragma if you are not using // a Microsoft compiler. #pragma warning(disable: 4996) using std::cout; using std::cin; using std::string; // Function …
All 5 Replies
sheennave
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
sheennave
0
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
sheennave
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.