Skip to content

Commit 4be44f3

Browse files
committed
Specify precision in CPU percent output
More consistent formatting.
1 parent 8c2f0e2 commit 4be44f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

common/main.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ std::string cpu_string( CPU_MODE cpu_mode, unsigned int cpu_usage_delay, unsigne
8787
oss << "]";
8888
}
8989
oss.width( 5 );
90-
oss << percentage * multiplier;
90+
oss.setf( std::ios::fixed, std::ios::floatfield );
91+
oss.precision( 1 );
92+
oss.fill( ' ' );
93+
oss << std::right << percentage * multiplier;
9194
oss << "%";
9295
if( use_colors )
9396
{

0 commit comments

Comments
 (0)