mirror of
https://github.com/thewtex/tmux-mem-cpu-load.git
synced 2026-09-10 07:16:16 -04:00
Merge pull request #25 from jasperla/ws
Don't print trailing whitespace for last element
This commit is contained in:
commit
557528b946
|
|
@ -62,7 +62,15 @@ std::string load_string( bool use_colors = false )
|
|||
{
|
||||
// Round to nearest, make sure this is only a 0.00 value not a 0.0000
|
||||
float avg = floorf( static_cast<float>( averages[i] ) * 100 + 0.5 ) / 100;
|
||||
ss << avg << " ";
|
||||
// Don't print trailing whitespace for last element
|
||||
if ( i == nelem-1 )
|
||||
{
|
||||
ss << avg;
|
||||
}
|
||||
else
|
||||
{
|
||||
ss << avg << " ";
|
||||
}
|
||||
}
|
||||
|
||||
if( use_colors )
|
||||
|
|
|
|||
Loading…
Reference in a new issue