Browse Source

Fixed precision of float numbers

Ivan Arkhipov 5 years ago
parent
commit
47ec7a3752
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/Legacy/models/downloader.cpp
  2. 1 1
      src/Legacy/models/patchdownloader.cpp

+ 2 - 2
src/Legacy/models/downloader.cpp

@@ -76,7 +76,7 @@ QString Downloader::getSpeedFormatted(quint64 speed_bytes_per_sec)
         speed /= 1024*1024;
         unit = "MB/s";
     }
-    return QString::number(speed, 'g', 1) + " " + unit;
+    return QString::number(speed, 'f', 1) + " " + unit;
 }
 
 QString Downloader::getSizeFormatted(quint64 bytes)
@@ -92,7 +92,7 @@ QString Downloader::getSizeFormatted(quint64 bytes)
         size /= 1024*1024;
         unit = "MB";
     }
-    return QString::number(size, 'g', 1) + " " + unit;
+    return QString::number(size, 'f', 1) + " " + unit;
 }
 
 

+ 1 - 1
src/Legacy/models/patchdownloader.cpp

@@ -57,7 +57,7 @@ QString PatchDownloader::getPredictedDownloadSizeFormatted()
         unit = "Гб";
     }
 
-    return QString::number(mbytes, 'g', 1) + " " + unit;
+    return QString::number(mbytes, 'f', 1) + " " + unit;
 }
 
 QString PatchDownloader::getDatabasePathByPatchName(QString name)