Fix format of duration

This commit is contained in:
Ricardo Montañana Gómez 2023-12-17 01:45:04 +01:00
parent 9b8db37a4b
commit 7de11b0e6d
Signed by: rmontanana
GPG Key ID: 46064262FD9A7ADE
2 changed files with 2 additions and 2 deletions

View File

@ -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();
}
};

View File

@ -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<string>()
<< " " << setw(8) << value["duration"].get<string>() << " " << setw(8) << setprecision(6)
<< " " << setw(8) << right << value["duration"].get<string>() << " " << setw(8) << setprecision(6)
<< fixed << right << value["score"].get<double>() << " " << value["hyperparameters"].dump() << std::endl;
odd = !odd;
}