From: Joel Rosdahl Date: Mon, 2 Jan 2023 19:46:25 +0000 (+0100) Subject: feat: Consistently show cache size and max size with one decimal X-Git-Tag: v4.8~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26f8e94b86df915a33152f35697b5446442efb1b;p=thirdparty%2Fccache.git feat: Consistently show cache size and max size with one decimal --- diff --git a/src/core/Statistics.cpp b/src/core/Statistics.cpp index 13302fe92..e76ea5e01 100644 --- a/src/core/Statistics.cpp +++ b/src/core/Statistics.cpp @@ -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 size_cells{ " Cache size (GB):", - C(FMT("{:.2f}", static_cast(local_size) / g)).right_align()}; + C(FMT("{:.1f}", static_cast(local_size) / g)).right_align()}; if (config.max_size() != 0) { size_cells.emplace_back("/"); size_cells.emplace_back( - C(FMT("{:.2f}", static_cast(config.max_size()) / g)) + C(FMT("{:.1f}", static_cast(config.max_size()) / g)) .right_align()); size_cells.emplace_back(percent(local_size, config.max_size())); }