diff options
author | David <dbphillipsnz@gmail.com> | 2014-05-10 21:30:16 +1200 |
---|---|---|
committer | David <dbphillipsnz@gmail.com> | 2014-05-10 21:30:16 +1200 |
commit | 2f363ccbee35d265866f04ba6ca34ab2e0ebe4d6 (patch) | |
tree | 00dfe6457aa54bad46adea2894df365246d6ecef /getfreq.c | |
parent | c6b5a3477b87ced86356813a578c19f6b345008b (diff) | |
download | paramano-2f363ccbee35d265866f04ba6ca34ab2e0ebe4d6.tar.xz |
Header/includes tidy-up
Diffstat (limited to 'getfreq.c')
-rw-r--r-- | getfreq.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -18,7 +18,6 @@ #include "getfreq.h" #include "getcore.h" -#include "math.h" #include <stdio.h> #include <stdlib.h> @@ -109,12 +108,8 @@ int gf_available(int core, char* out, int size) void gf_get_frequency_label(int freq, char* out) { - int i = 0; - while(freq/pow(10, i) >= 1) - ++i; - - if(i == 7) - sprintf(out, "%.2f GHz", freq/pow(10, i-1)); + if(freq >= 1000000) // >= 1 million KHz (1GHz) + sprintf(out, "%.2f GHz", ((float)freq/1000000) ); else sprintf(out, "%.2d MHz", freq/1000); |