Hello, guys. I`ve got a little problem
I`m using QT4.4.0+VC++2008
Database SQLite.
I have 3 double columns in the database:
1 = 100000.55
2 = 10000.55
3 = 1000.55
I`m selecting those values and displaying in QLabel
double eur, usd, bgn;
while (query.next()) {
eur= query.value(1).toDouble();
usd = query.value(2).toDouble();
bgn= query.value(3).toDouble();
}
QSqlQuery query("SELECT * FROM main");
double eur, usd, bgn;
while (query.next()) {
eur= query.value(1).toDouble();
usd = query.value(2).toDouble();
bgn= query.value(3).toDouble();
}
To copy to clipboard, switch view to plain text mode
but there goes the rounding problem:
1st value goes 100001
2nd value goes 10000.5
3rd value goes 1000.55
What am i missing and how to make 1st value to be shown as 100000.55
I`ve got alot of calculations and that rounding is a problem. Thanx.
PS. If i make it "eur= query.value(1).toString();" it shows the correct value but i need to do calculations and at some time i`ll call str.toDouble() and i get the round again.
Bookmarks