Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.4

Bug #8601 setNumFormat() for numbers stored as text doesn't work for numbers.
Submitted: 2006-08-31 19:45 UTC
From: wizard at roborooter dot com Assigned: progi1984
Status: Closed Package: Spreadsheet_Excel_Writer (version 0.9.2)
PHP Version: 5.2.0 RC2 OS: windows 2000/xp
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2010-03-31 17:34 UTC
Package:
Bug Type:
Summary:
From: wizard at roborooter dot com
New email:
PHP Version: Package Version: OS:

 

 [2006-08-31 19:45 UTC] wizard at roborooter dot com (Francis)
Description: ------------ $textFormat->setNumFormat('@') or $textFormat->setNumFormat(49) doesn't work for formatting data as text (such as numbers that you want stored as text). I referred to open office document for the excel file format (page 160) for the @ and the 49 that should refer to formatting as text. So numbers starting with zero loose their zeros and long numbers show as scientific notation. Test script: --------------- <?php require_once "Spreadsheet/Excel/Writer.php"; $workbook =& new Spreadsheet_Excel_Writer(); $workbook->send('test.xls'); $textFormat =& $workbook->addFormat(); $textFormat->setNumFormat('@'); //or 49 $sheet1 =& $workbook->addWorksheet('Not my first sheet'); $sheet1->setColumn(0,0,20,$textFormat); $sheet1->write(0,0,"000034534"); $sheet1->write(1,0,"100000298109"); $sheet1->write(2,0,"00324838284"); $sheet1->write(3,0,"00456744675454654556"); $workbook->close(); ?> Expected result: ---------------- 000034534 100000298109 00324838284 00456744675454654556 Actual result: -------------- 34534 1E+11 324838284 4.56745E+17

Comments

 [2008-03-07 20:25 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2008-07-17 12:25 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2009-11-28 23:15 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2009-11-28 23:16 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2009-11-29 05:36 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2009-11-29 05:46 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2010-03-31 17:34 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!