Browse Source

Update calculation formula for progress percentage (#386)

Aristo Chen 5 years ago
parent
commit
ac18b70a0f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      README.md

+ 1 - 1
README.md

@@ -362,7 +362,7 @@ std::shared_ptr<httplib::Response> res =
   cli.Get("/", [](uint64_t len, uint64_t total) {
   cli.Get("/", [](uint64_t len, uint64_t total) {
     printf("%lld / %lld bytes => %d%% complete\n",
     printf("%lld / %lld bytes => %d%% complete\n",
       len, total,
       len, total,
-      (int)((len/total)*100));
+      (int)(len*100/total));
     return true; // return 'false' if you want to cancel the request.
     return true; // return 'false' if you want to cancel the request.
   }
   }
 );
 );