Jelajahi Sumber

2009-05-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Abbreviated KiB/s to KiBs and its precision decreased to 1 to save
	space in console readout. Also they are now shown in MiB/s if
	speed > 1024KiB/s.
	* src/ConsoleStatCalc.cc
Tatsuhiro Tsujikawa 16 tahun lalu
induk
melakukan
a839b42747
2 mengubah file dengan 10 tambahan dan 3 penghapusan
  1. 7 0
      ChangeLog
  2. 3 3
      src/ConsoleStatCalc.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2009-05-19  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Abbreviated KiB/s to KiBs and its precision decreased to 1 to save
+	space in console readout. Also they are now shown in MiB/s if
+	speed > 1024KiB/s.
+	* src/ConsoleStatCalc.cc
+
 2009-05-19  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Added SEED to console output, which represents the number of

+ 3 - 3
src/ConsoleStatCalc.cc

@@ -127,12 +127,12 @@ static void printProgress
   if(!rg->downloadFinished()) {
     o << " "
       << "SPD:"
-      << std::fixed << std::setprecision(2) << stat.getDownloadSpeed()/1024.0 << "KiB/s";
+      << Util::abbrevSize(stat.getDownloadSpeed()) << "Bs";
   }
   if(stat.getSessionUploadLength() > 0) {
     o << " "
       << "UP:"
-      << std::fixed << std::setprecision(2) << stat.getUploadSpeed()/1024.0 << "KiB/s"
+      << Util::abbrevSize(stat.getUploadSpeed()) << "Bs"
       << "(" << Util::abbrevSize(stat.getAllTimeUploadLength()) << "B)";
   }
   if(eta > 0) {
@@ -235,7 +235,7 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e)
     TransferStat stat = e->_requestGroupMan->calculateStat();
     o << " "
       << "[TOTAL SPD:"
-      << std::fixed << std::setprecision(2) << stat.getDownloadSpeed()/1024.0 << "KiB/s" << "]";
+      << Util::abbrevSize(stat.getDownloadSpeed()) << "Bs" << "]";
   }
 
   {