OSDN Git Service

Removing redundant error checking related to booking declaration.
[tjqt4port/tj2qt4.git] / taskjuggler / RealFormat.cpp
index 6926da2..be1e0af 100644 (file)
@@ -39,7 +39,7 @@ RealFormat::format(double val, bool showZeroFract) const
 {
     /* The algorithm further down does only truncation after fracDigits. So we
      * have to do real rounding first. */
-    val = qRound(val * pow(10, fracDigits)) / pow(10, fracDigits);
+    val = qRound(val * pow(10.0f, (int)fracDigits)) / pow(10.0f, (int)fracDigits);
 
     QString text;
     for (double v = fabs(val); v >= 1.0; v /= 1000)
@@ -57,7 +57,7 @@ RealFormat::format(double val, bool showZeroFract) const
     if (!fractionSep.isEmpty() && fracDigits > 0)
     {
         double v = fabs(val) - abs(static_cast<int>(val));
-        int fract = static_cast<int>(v * pow(10fracDigits));
+        int fract = static_cast<int>(v * pow(10.0f, (int)fracDigits));
         QString fracStr = QString("%1").arg(fract);
         /* Prepend zeros if fractStr is not fracDigits long */
         if (fracStr.length() < fracDigits)