summaryrefslogtreecommitdiff
path: root/string_utils.c
diff options
context:
space:
mode:
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);