|
From: Andrew M. <an...@ob...> - 2005-02-24 17:05:42
|
>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)
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
|