I am running Qt 4.2.2 on FreeBSD 4.8 with gcc 3.4.6. I am working with dollar amounts in doubles but I cannot properly convert these doubles into QStrings for display in a QLabel. As a test I compiled the following very simple code:

Qt Code:
  1. #include <QtCore>
  2. int main () {
  3. double doublevar = 42.84;
  4.  
  5. qDebug() << QString::number(doublevar);
  6. }
To copy to clipboard, switch view to plain text mode 

Which outputs "-0" to the terminal. What could be causing this? The same code in this simple program runs fine on my Linux and Windows boxes. If I use a QVariant as below:
Qt Code:
  1. #include <QtCore>
  2. int main () {
  3. double doublevar = 42.84;
  4.  
  5. QVariant var(doublevar);
  6. qDebug() << var.toString();
  7. }
To copy to clipboard, switch view to plain text mode 
The output is "-0.00000000005965e+224". Again, what could be wrong?

Thanks
mAx