That's the problem...What was happening is I was assigning the values I pulled from the database into my amount textbox using:Originally Posted by jacek
txtAmount->setText( QString::number(fValue) );
This was truncating my cents when the value got over 10,000! Then, later, when I pulled it out of the textbox, the value was wrong. I was using the qDebug() to print, and this was masking the error since it was also truncating the cents. This error ONLY occurred when values were over 10,000 (which is unusual in my app) so the problem rarely occurred.
I'm glad this was the problem. I was starting to think that I didn't understand the behavior of floating point numbers!
Bookmarks