From 1e40f9dd9db0726b10b58492b2ee0438f7a5e208 Mon Sep 17 00:00:00 2001 From: "Eric B. Ridge" Date: Fri, 18 Sep 2026 15:18:09 +0000 Subject: [PATCH] Show fractional gigabytes in progress --- src/bin/pgcopydb/cli_list.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bin/pgcopydb/cli_list.c b/src/bin/pgcopydb/cli_list.c index cf61b375d..6d3078fbb 100644 --- a/src/bin/pgcopydb/cli_list.c +++ b/src/bin/pgcopydb/cli_list.c @@ -2289,11 +2289,14 @@ cli_list_progress(int argc, char **argv) char totalBytesPretty[BUFSIZE] = { 0 }; char doneBytesPretty[BUFSIZE] = { 0 }; char inProgressBytesPretty[BUFSIZE] = { 0 }; - - pretty_print_bytes(totalBytesPretty, BUFSIZE, progress.totalBytes); - pretty_print_bytes(doneBytesPretty, BUFSIZE, progress.doneBytes); - pretty_print_bytes(inProgressBytesPretty, BUFSIZE, - progress.inProgressBytes); + const double bytesPerGB = 1024.0 * 1024.0 * 1024.0; + + sformat(totalBytesPretty, BUFSIZE, "%.3f GB", + ((double) progress.totalBytes) / bytesPerGB); + sformat(doneBytesPretty, BUFSIZE, "%.3f GB", + ((double) progress.doneBytes) / bytesPerGB); + sformat(inProgressBytesPretty, BUFSIZE, "%.3f GB", + ((double) progress.inProgressBytes) / bytesPerGB); fformat(stdout, "%12s | %12s | %12s | %12s\n", "Bytes",