[Gambas-user] number format

Benoit Minisini gambas at ...1...
Thu Feb 21 18:14:49 CET 2008


On dimanche 27 janvier 2008, Epíleg wrote:
> En/na Fabien Bodard ha escrit:
> > simply do val(textbox.text) but you must take care that your system
> > location is correct
>
> I got a wrong behavior with 'val' function (I think).
>
>
> In an US English locale, I got this:
>
> Val("1,234,567.89")  =>  1234567.89
>
>
> In a Germany German locale:
>
> Val("1.234.567,89")  =>  1234567.89
>
>
> But in a France French locale:
>
> Val("1 234 567,89")  =>  1
>
>
> The thousands separator in all locales cases are correctly set:
>
> $ LANG=en_US.UTF-8 locale -k LC_NUMERIC
> decimal_point="."
> thousands_sep=","
> grouping=3;3
> numeric-decimal-point-wc=46
> numeric-thousands-sep-wc=44
> numeric-codeset="UTF-8"
>
> a$ LANG=de_DE.UTF-8 locale -k LC_NUMERIC
> decimal_point=","
> thousands_sep="."
> grouping=3;3
> numeric-decimal-point-wc=44
> numeric-thousands-sep-wc=46
> numeric-codeset="UTF-8"
>
> $ LANG=fr_FR.UTF-8 locale -k LC_NUMERIC
> decimal_point=","
> thousands_sep=" "
> grouping=3;3
> numeric-decimal-point-wc=44
> numeric-thousands-sep-wc=32
> numeric-codeset="UTF-8"
>
> Thanks,
> Epíleg.
>

This bug has been fixed in the 2.x branch, revision 1092.

-- 
Benoit Minisini




More information about the User mailing list