<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
L'Ordinateur du Particulier wrote:
<blockquote TYPE=CITE>Hi,
<p>i have some problems with string to float conversion in python
<p>before importing gtk module, the string "6.6" is converted into float
<br>without problem, but after the gtk module has been imported,
<br>the syntax "6.6" is invalid, python's waiting "6,6" ...
<p>the float() function seems to have been overwritten !?
<p>is there a way to choose which decimal separator to use ?
<p>Regards
<p>Fabrice PIERROT</blockquote>
<tt>Hi,</tt><tt></tt>
<p><tt>I use the following statements in nearly all python main programs</tt>
<br><tt>after the import of all other modules:</tt>
<br><tt>--------------------</tt><tt></tt>
<p><tt>import locale</tt>
<br><tt>locale.setlocale(locale.LC_ALL, '')      
# Use preferred locale for sorting etc.</tt>
<br><tt>locale.setlocale(locale.LC_NUMERIC, 'C')  # Use default C
locale for numbers</tt><tt></tt>
<p><tt>--------------------</tt>
<br><tt>Regards Ulli</tt>
<br><tt></tt> </html>