Kommastellen
Verfasst: 18. April 2012 17:13
Warum wird mir hier immer eine Zahl ohne Kommestellen ausgegeben??
Ausgabe: 23
Setze ich jedoch eine beliebige Zahl ein:
So werden mir Kommastellen ausgegeben...
Warum in Beispiel 1 nicht??
Edit:
Gibt aus:
lG
Code: Alles auswählen
qDebug() << static_cast<float>( static_cast<float>(row["throughput"].toFloat()) / 1024.0 );Setze ich jedoch eine beliebige Zahl ein:
Code: Alles auswählen
static_cast<float>( static_cast<float>(14) / 1024.0 );Warum in Beispiel 1 nicht??
Edit:
Code: Alles auswählen
qDebug() << static_cast<float>( static_cast<float>(num.toFloat()) / 1024.0 );
qDebug() << num;
qDebug() << static_cast<float>( static_cast<float>(row["throughput"].toFloat()) / 1024.0 );
qDebug() << row["throughput"];Wie genau muss ich ein "qulonglong" konventieren, um Komma zu erhalten??0.0283203
QVariant(int, 29)
23
QVariant(qulonglong, 23552)
lG