summaryrefslogtreecommitdiff
path: root/string_utils.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-09-05 15:27:54 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-09-05 15:27:54 -0400
commit7055df2fedee4a1b5fc0303fadfe315b5ffeffa4 (patch)
tree182ec16ebde5970314bebd9b000d6266878857bd /string_utils.c
parentce20f1608a89a695ee5df57d42e2f0eda6979de2 (diff)
scope reductions
Diffstat (limited to 'string_utils.c')
-rw-r--r--string_utils.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/string_utils.c b/string_utils.c
index 651a3c7..bf17e50 100644
--- a/string_utils.c
+++ b/string_utils.c
@@ -45,12 +45,6 @@ void String_Parameter_To_Text(float Float_To_Convert, int significant_digits,
gchar *floating_val = NULL;
gchar *unit_mult = NULL; /* units multiplier, eg. M, k, u */
- int i; /* just a counter */
- int shift_decimal_by; /* if the exponent isn't a multiple of 3, the decimal point will be moved */
- int decimal_location; /* where the decimal is in the number string */
-
- int exponent_val; /* the exponent, in integer form */
-
/* Copy the floating point value to a string. Do not multiply to accomodate units; the roundoff */
/* is annoying. (e.g. 1.000 -> 0.999) */
/* Move the decimal with string manipulations instead. */
@@ -65,6 +59,11 @@ void String_Parameter_To_Text(float Float_To_Convert, int significant_digits,
strcat(LCD_string,out_val);
g_free (out_val);
} else {
+ int i;
+ int shift_decimal_by; /* if the exponent isn't a multiple of 3, the decimal point will be moved */
+ int decimal_location; /* where the decimal is in the number string */
+ int exponent_val; /* the exponent, in integer form */
+
GString *out_gstr = g_string_new ("");
Float_To_Text(remote_digits_after_decimal,Float_To_Convert,&floating_val);