Ver Fonte

Reset stream format state

Tatsuhiro Tsujikawa há 13 anos atrás
pai
commit
8566d050ff
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      src/ConsoleStatCalc.cc

+ 4 - 1
src/ConsoleStatCalc.cc

@@ -115,8 +115,11 @@ void printProgress
      rg->downloadFinished()) {
     o << "SEEDING" << "(" << "ratio:";
     if(rg->getCompletedLength() > 0) {
+      std::streamsize oldprec = o.precision();
       o << std::fixed << std::setprecision(1)
-        << ((stat.allTimeUploadLength*10)/rg->getCompletedLength())/10.0;
+        << ((stat.allTimeUploadLength*10)/rg->getCompletedLength())/10.0
+        << std::setprecision(oldprec)
+        << std::resetiosflags(std::ios::fixed);
     } else {
       o << "--";
     }