diff --git a/README.rst b/README.rst index 08adebd..f499fd9 100644 --- a/README.rst +++ b/README.rst @@ -116,7 +116,7 @@ The full usage:: Available options: -h, --help Prints this help message - --colors + -c, --colors Use tmux colors in output --powerline-right Use powerline symbols throughout the output, DO NOT reset background color at the end, enables --colors diff --git a/common/main.cc b/common/main.cc index 211c4be..6d76f1f 100644 --- a/common/main.cc +++ b/common/main.cc @@ -51,10 +51,17 @@ std::string cpu_string( CPU_MODE cpu_mode, unsigned int cpu_usage_delay, unsigne percentage = cpu_percentage( cpu_usage_delay ); // set multiplier to number of threads ? - if ( cpu_mode == CPU_MODE_THREADS ) { + if ( cpu_mode == CPU_MODE_THREADS ) + { multiplier = get_cpu_count(); } + // if percentage*multiplier >= 100, remove decimal point to keep number short + if ( percentage*multiplier >= 100.0f ) + { + oss.precision( 0 ); + } + if( use_colors ) { unsigned int percent = static_cast( percentage );