Переглянути джерело

2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Set precision to 2 because share ratio is rounded into 1.0 if 
precision
	set to 1.
	* src/ConsoleStatCalc.cc (calculateStat)
Tatsuhiro Tsujikawa 18 роки тому
батько
коміт
1fed0c0cb0
3 змінених файлів з 7 додано та 2 видалено
  1. 6 0
      ChangeLog
  2. 0 1
      TODO
  3. 1 1
      src/ConsoleStatCalc.cc

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2007-11-22  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	Set precision to 2 because share ratio is rounded into 1.0 if precision
+	set to 1.
+	* src/ConsoleStatCalc.cc (calculateStat)
+
 2007-11-20  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 2007-11-20  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 
 	Preallocate non-requested file which is adjacent forward to requested
 	Preallocate non-requested file which is adjacent forward to requested

+ 0 - 1
TODO

@@ -57,4 +57,3 @@
 -- remaining issues to be implemented for 0.12.0 release
 -- remaining issues to be implemented for 0.12.0 release
 * Update translation
 * Update translation
 * replace strtol with Util::parseInt
 * replace strtol with Util::parseInt
-* precision of share ratio

+ 1 - 1
src/ConsoleStatCalc.cc

@@ -71,7 +71,7 @@ ConsoleStatCalc::calculateStat(const RequestGroupManHandle& requestGroupMan,
     if(firstRequestGroup->downloadFinished() &&
     if(firstRequestGroup->downloadFinished() &&
        !BtContextHandle(firstRequestGroup->getDownloadContext()).isNull()) {
        !BtContextHandle(firstRequestGroup->getDownloadContext()).isNull()) {
       cout << "SEEDING" << "(" << "ratio:"
       cout << "SEEDING" << "(" << "ratio:"
-	   << fixed << setprecision(1) << stat.getAllTimeUploadLength()*1.0/firstRequestGroup->getCompletedLength()
+	   << fixed << setprecision(2) << stat.getAllTimeUploadLength()*1.0/firstRequestGroup->getCompletedLength()
 	   << ")";
 	   << ")";
     } else
     } else
 #endif // ENABLE_BITTORRENT
 #endif // ENABLE_BITTORRENT