guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

locale-dependent number parsing?


From: Linas Vepstas
Subject: locale-dependent number parsing?
Date: Mon, 5 Apr 2010 11:56:09 -0500

I've found the following bug/feature with guile-1.8.7 and would like to solicit for comments.
Is this a guile bug? What's the proper work-around?

I've got a C program that does a setlocale (LC_ALL, "");   printf ("%f", 0.2000);

In the de_DE.utf8 locale, the result of the print is 0,2000  using a comma, since
the comma is the "decimal separator" in most European locales. This numeric
string is then passed to scm_eval_string() which pukes on it, because it does not
recognize 0,2  as a valid number.    This can be confirmed at the guile command
line interpreter, which pukes on guile> (+ 0,2 0,2)  but works fine on (+ 0.2 0.2)
even in the de_DE locale.

Is this really the expected behaviour? Is there a suggested work-around?

--linas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]