]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
feat: Consistently show cache size and max size with one decimal
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 2 Jan 2023 19:46:25 +0000 (20:46 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 11 Jan 2023 18:42:32 +0000 (19:42 +0100)
src/core/Statistics.cpp

index 13302fe9252d8d544e002cd6ff678391bdbab2ad..e76ea5e013f1696414f7ab2de442db00cc9f4516 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021-2022 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2023 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -323,11 +323,11 @@ Statistics::format_human_readable(const Config& config,
   if (!from_log) {
     std::vector<C> size_cells{
       "  Cache size (GB):",
-      C(FMT("{:.2f}", static_cast<double>(local_size) / g)).right_align()};
+      C(FMT("{:.1f}", static_cast<double>(local_size) / g)).right_align()};
     if (config.max_size() != 0) {
       size_cells.emplace_back("/");
       size_cells.emplace_back(
-        C(FMT("{:.2f}", static_cast<double>(config.max_size()) / g))
+        C(FMT("{:.1f}", static_cast<double>(config.max_size()) / g))
           .right_align());
       size_cells.emplace_back(percent(local_size, config.max_size()));
     }