From 7de11b0e6d73eef4a9e6c609400c883b6c969afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Sun, 17 Dec 2023 01:45:04 +0100 Subject: [PATCH] Fix format of duration --- src/Platform/Timer.h | 2 +- src/Platform/b_grid.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Platform/Timer.h b/src/Platform/Timer.h index 277fb6d..dd10d94 100644 --- a/src/Platform/Timer.h +++ b/src/Platform/Timer.h @@ -35,7 +35,7 @@ namespace platform { double durationShow = duration > 3600 ? duration / 3600 : duration > 60 ? duration / 60 : duration; std::string durationUnit = duration > 3600 ? "h" : duration > 60 ? "m" : "s"; std::stringstream ss; - ss << std::setw(7) << std::setprecision(2) << std::fixed << durationShow << " " << durationUnit << " "; + ss << std::setprecision(2) << std::fixed << durationShow << " " << durationUnit; return ss.str(); } }; diff --git a/src/Platform/b_grid.cc b/src/Platform/b_grid.cc index 5bb6c9c..d870353 100644 --- a/src/Platform/b_grid.cc +++ b/src/Platform/b_grid.cc @@ -133,7 +133,7 @@ void list_results(json& results, std::string& model) std::cout << color; std::cout << std::setw(3) << std::right << index++ << " "; std::cout << left << setw(spaces) << key << " " << value["date"].get() - << " " << setw(8) << value["duration"].get() << " " << setw(8) << setprecision(6) + << " " << setw(8) << right << value["duration"].get() << " " << setw(8) << setprecision(6) << fixed << right << value["score"].get() << " " << value["hyperparameters"].dump() << std::endl; odd = !odd; }