write float to Excel with pyExcelerator write

Peter Otten __peter__ at web.de
Mon Mar 3 05:43:04 EST 2008


Cyril.Liu 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? some body help me please.

It's probably a bug in pyExcelerator:

http://sourceforge.net/tracker/index.php?func=detail&aid=1596642&group_id=134081&atid=730643

There's a patch by John Machin, 

http://sourceforge.net/tracker/index.php?func=detail&aid=1618443&group_id=134081&atid=730645

and the problem should be fixed in subversion.

Peter



More information about the Python-list mailing list