diff options
Diffstat (limited to 'string_utils.c')
-rw-r--r-- | string_utils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/string_utils.c b/string_utils.c index a5f6e6f..651a3c7 100644 --- a/string_utils.c +++ b/string_utils.c @@ -63,10 +63,10 @@ void String_Parameter_To_Text(float Float_To_Convert, int significant_digits, gchar *out_val; out_val = g_strdup_printf ("%d", (int) Float_To_Convert); strcat(LCD_string,out_val); - g_free (out_val); + g_free (out_val); } else { GString *out_gstr = g_string_new (""); - + Float_To_Text(remote_digits_after_decimal,Float_To_Convert,&floating_val); /* -- COPY FIRST ONE OR TWO CHARACTERS -- */ @@ -77,11 +77,11 @@ void String_Parameter_To_Text(float Float_To_Convert, int significant_digits, } else if (show_plus_sign==YES) { /* if it's positive and plus sign required ... */ decimal_location=1; /* decimal at position one (e.g.: 2.23e-9) */ - out_gstr = g_string_append_c (out_gstr, '+'); /* copy minus sign */ - out_gstr = g_string_append_c (out_gstr, floating_val[0]); /* copy first digit */ + out_gstr = g_string_append_c (out_gstr, '+'); /* copy minus sign */ + out_gstr = g_string_append_c (out_gstr, floating_val[0]); /* copy first digit */ } else { /* if it's positive and plus sign not required ... */ decimal_location=1; /* decimal at position one (e.g.: 2.23e-9) */ - out_gstr = g_string_append_c (out_gstr, floating_val[0]); /* copy first digit */ + out_gstr = g_string_append_c (out_gstr, floating_val[0]); /* copy first digit */ } int digits_so_far = 1; @@ -119,7 +119,7 @@ void String_Parameter_To_Text(float Float_To_Convert, int significant_digits, /* move the digits that will come before the decimal */ for (i=decimal_location; i<decimal_location+shift_decimal_by; ++i) { - out_gstr = g_string_append_c (out_gstr, floating_val[1+i]); + out_gstr = g_string_append_c (out_gstr, floating_val[1+i]); ++digits_so_far; } |