Getting back the real value from a money formated cell

Topics: Developer Forum, Project Management Forum, User Forum
Oct 26, 2008 at 10:33 PM
I have an excel file that has a column of dollar amounts.  In excel the format for the field is this:

"$"#,##0.00_);[RED]\("$"#,##0.00\)

When I try to access the data stored in this cell, I get this back:

-2147483648

Needless to say, this isn't the value I wanted.  How do you get the number value from a cell like this?  I am currently using Excel5.

Thank you in advance.




Oct 26, 2008 at 10:38 PM
Oh, forgot to add.  Setting $objReader->setReadDataOnly(true); works.  But the other pieces in the spreadsheet stop working the way I want it to.

Developer
Oct 27, 2008 at 1:27 AM
Yes, there was such an issue with PHPExcel 1.6.3, but it was fixed.
http://www.codeplex.com/PHPExcel/WorkItem/View.aspx?WorkItemId=7536

Please try with latest source. It should work with that, else post back
http://www.codeplex.com/PHPExcel/SourceControl/ListDownloadableCommits.aspx

Oct 27, 2008 at 3:04 AM
Koyama:

Downloaded the last version, and sure enough it fixed my problem.  Oddly enough, I did have PHPExcel 1.6.3 already installed on the system, however, the latest version fixed my problem.  Thank you for the help.

Best regards,
NiteRain