[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: write float to Excel with pyExcelerator write

John Machin

3/3/2008 12:15:00 PM

On Mar 1, 5:59 pm, Cyril.Liu <terry6...@gmail.com> wrote:
> I use pyExcelerator to generat Excel files in my project. it works good
> before I found this bug:
> run this code:
>
> from pyExcelerator import *
> wb = Workbook()
> ws = wb.add_sheet("sheet")
> for i in xrange(1):
> ws.write(i,0, 10474224.6)
> wb.save(r'd:\error_float.xls')
>
> open d:\error_float.xls with M$ Excle you'll find the number in the cell is
> -263193.64 not 10474224.6
>
> why?

The author assumed unsigned integers instead of signed integers.

>>> 1047422460 - 2**30
-26319364

See the following, previously posted here:

http://mail.python.org/pipermail/python-list/2007-May/4...

Cheers,
John