Re: decimal separator
- From: "David Necas (Yeti)" <yeti physics muni cz>
- To: Quentin <squentin free fr>
- Cc: gtk-list gnome org
- Subject: Re: decimal separator
- Date: Tue, 24 Jan 2006 21:28:04 +0100
On Tue, Jan 24, 2006 at 09:21:48PM +0100, Quentin wrote:
>
> Here is how I deal with this problem in my program :
>
> use POSIX qw/locale_h/;
>
> # code that don't care what the decimal separator is
> setlocale(LC_NUMERIC, 'C');
> # code that needs the decimal separator to be '.'
> setlocale(LC_NUMERIC, '');
> # code that don't care what the decimal separator is
>
> Let me know if there is a better way.
Definitely. See g_ascii_strtod(), g_ascii_dtostr(), and
related functions.
Moreover GUI should normally follow locale settings, that's
quite different from `code that doesn't care what the
decimal separator is'. Number format fixed to C is usual
in data files, however.
Yeti
--
That's enough.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]