round corrrectly (not always down) in cpufreq theme

SVN revision: 75396
This commit is contained in:
Carsten Haitzler 2012-08-18 01:00:25 +00:00
parent 3361ea98f0
commit 3517cea324
1 changed files with 2 additions and 0 deletions

View File

@ -13748,9 +13748,11 @@ collections {
freq = (freq - min_freq) / (max_freq - min_freq);
set_state(PART:"meter", "default", freq);
if (f < 1000000) {
f += 500;
snprintf(text, 100, "%i", f / 1000);
}
else {
f += 50000;
snprintf(text, 100, "%i.%i", f / 1000000,
(f % 1000000) / 100000);
}