Use consistent precision for load output
Reduce variations in output.
This commit is contained in:
parent
d5007d4694
commit
8c2f0e2cfd
@ -39,6 +39,8 @@ std::string load_string( bool use_colors,
|
|||||||
short num_averages )
|
short num_averages )
|
||||||
{
|
{
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
|
ss.setf( std::ios::fixed, std::ios::floatfield );
|
||||||
|
ss.precision( 2 );
|
||||||
double averages[num_averages];
|
double averages[num_averages];
|
||||||
// based on: opensource.apple.com/source/Libc/Libc-262/gen/getloadavg.c
|
// based on: opensource.apple.com/source/Libc/Libc-262/gen/getloadavg.c
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user