Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: write float to Excel with pyExcelerator write

Reply
Thread Tools

Re: write float to Excel with pyExcelerator write

 
 
John Machin
Guest
Posts: n/a
 
      03-03-2008
On Mar 1, 5:59 pm, Cyril.Liu <(E-Mail Removed)> 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/pyt...ay/441633.html

Cheers,
John


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
float to string to float, with first float == second float Carsten Fuchs C++ 45 10-08-2009 09:47 AM
Re: write float to Excel with pyExcelerator write Peter Otten Python 0 03-03-2008 10:43 AM
RE: Formmating excel cells with PyExcelerator or COM Tim Golden Python 0 05-15-2006 12:47 PM
Installing PyExcelerator to write Excel files from Python tkpmep@hotmail.com Python 3 03-21-2006 07:06 PM
Re: float->byte->float is same with original float image. why float->ubyte->float is different??? bd C Programming 0 07-07-2003 12:09 AM



Advertisments