From: Marcos <ma...@bu...> - 2005-02-25 05:47:37
|
Probably related to this: This is one of the new things in Python 2.4. Now there is a locale-independent (C locale) way of treating numbers. I bet the module has to be adapted to this change to take advantage of this fact (and letting users choose their own locale without breaking apps). http://www.python.org/doc/2.4/whatsnew/node11.html Andrew McNamara dijo: >>I have some problem, when I use Sybase module with GTK: >> >> cursor.execute(" select 1.2 ") >> num = cursor.fetchone()[0] >> print num # 1.2 >> print float(1.2) # 1.2 >> print float(num) # 1.2 >> >> import gtk >> print num # 1.2 >> print float(1.2) # 1.2 >> print float(num) # 1.0 <- not 1.2 >> >> >>After import gtk, the float truncates the decimal. >>How can I fix this? > > This is a shot in the dark, but could gtk be setting the locale? > > It might also be useful to print the type of num, eg: > > print type(num) > |