From 8c2f0e2cfd452670e0d5d51be0e6d415d8da71e0 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 3 Aug 2021 18:29:09 -0400 Subject: [PATCH] Use consistent precision for load output Reduce variations in output. --- common/load.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/load.cc b/common/load.cc index 31d0160..092ba8f 100644 --- a/common/load.cc +++ b/common/load.cc @@ -39,6 +39,8 @@ std::string load_string( bool use_colors, short num_averages ) { std::ostringstream ss; + ss.setf( std::ios::fixed, std::ios::floatfield ); + ss.precision( 2 ); double averages[num_averages]; // based on: opensource.apple.com/source/Libc/Libc-262/gen/getloadavg.c