aboutsummaryrefslogtreecommitdiff
path: root/getfreq.c
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-05-10 21:30:16 +1200
committerDavid <dbphillipsnz@gmail.com>2014-05-10 21:30:16 +1200
commit2f363ccbee35d265866f04ba6ca34ab2e0ebe4d6 (patch)
tree00dfe6457aa54bad46adea2894df365246d6ecef /getfreq.c
parentc6b5a3477b87ced86356813a578c19f6b345008b (diff)
downloadparamano-2f363ccbee35d265866f04ba6ca34ab2e0ebe4d6.tar.xz
Header/includes tidy-up
Diffstat (limited to 'getfreq.c')
-rw-r--r--getfreq.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/getfreq.c b/getfreq.c
index 4b00775..8984ecb 100644
--- a/getfreq.c
+++ b/getfreq.c
@@ -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);