>If you are doing serialization, you wouldn't change the locale but use
>the locale-independent functions provided by glib (g_ascii_strtod and
>g_ascii_dtostr).
i have a policy of not using glib functions in code that doesn't use
GTK. wrong-headed? perhaps. but there it is.
_
Hi,
Paul Davis <[EMAIL PROTECTED]> writes:
>> #include
>> setlocale(LC_ALL, "");
>
> as noted by someone else, this is a very very unfriendly thing to do
> unless it is restricted to places where you are doing
> "serialization" (ie. saving state to disk)
If you are doing serialization, you wo
>It's locale dependent, so make sure LC_NUMERIC is set to a locale that
>formats in that style (e.g. da_DK, and presumably your own). In order
>to use the locale stuff in C or C++, you need to call setlocale to set
>the locale stuff up.
that much is true.
>In C:
>
> #include
> setlocale(LC_AL
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hariyanto <[EMAIL PROTECTED]> writes:
> How I want to send string with number like 3456789 to GtkLabel with the
> output 3.456.789,00
> I try this code :
>
> str_total = g_strdup_printf("%f", dbl_total);
> str_total_formatted = g_strndup(str_total, s
How I want to send string with number like 3456789 to GtkLabel with the output
3.456.789,00
I try this code :
str_total = g_strdup_printf("%f", dbl_total);
str_total_formatted = g_strndup(str_total, strcspn(str_total, ".") +3);
and the output : 3456789.00
How to make the output : 3.456.789,00