Open GoogleCodeExporter opened 9 years ago
[deleted comment]
I've got the same problem. I couldn't find out where the problem comes from but
I
remarked that the sum of my negative number in Excel added to the number
returned by
php-excel-reader is always the same number.
You can also check it in the above example provided by npmarrin. The sum is
always
1073741824. I don't know if it can help.
In my example, I have the same number, except that my numbers got a decimal
part. For
example, I got 10728205.73 instead of 9212.51. The sum gives me 10737418.24
which is
slightely the same as npmarrin with a comma.
After making few tests, I remarked that the "magic" number 1073741824
correspond to 2^30.
I think I'm not so far from finding the solution but I can't figure out what it
is.
Any idea?
Original comment by antoine....@gmail.com
on 6 Jul 2009 at 8:14
I have the same problem. I am assuming that it is a 64 bit problem. It worked
fine
on my previous 32 bit machine.
Original comment by bowlingb...@gmail.com
on 1 Feb 2010 at 12:55
i have the same problem with excel files created in office 2003.
however the it is working with small negative numbers like -5000, but -6000 is
not
working.
Original comment by NilsLat...@gmail.com
on 3 Feb 2010 at 1:33
A temp fix is to modify _GetInt4d($data, $pos):
function _GetInt4d($data, $pos) {
$value = ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) <<
16) | (ord($data[$pos+3]) << 24);
if ($value>=4294967294) {
$value=-2;
}
if ($value >= 4000000000 && $value < 4294967294) // Add these lines
{
$value = -2 - 4294967294 + $value;
} // End add lines
return $value;
}
This artificially pushes the system to recognize when a negative number above
-2 has
turned up. However, it limits the maximum integer value to 4000000000 and the
maximum
negative integer value as well.
Still, it works for now.
Original comment by keanloon...@gmail.com
on 18 May 2010 at 8:11
Can try this fix that was listed here:
http://code.google.com/p/php-excel-reader/issues/detail?id=92
Works for me on a 64 bit Linux machine.
Original comment by keanloon...@gmail.com
on 19 Oct 2010 at 9:56
It did not work for me :(
Original comment by leo...@gmail.com
on 21 Oct 2010 at 11:36
Did you replace _GetInt4D completely?
Original comment by keanloon...@gmail.com
on 21 Oct 2010 at 12:40
I have an old version (and I don't know if i can update) and there where 2
GetInt4D and _GetInt4D. Now I updated the _GetInt4D and it works! Thank you
very much
Original comment by leo...@gmail.com
on 21 Oct 2010 at 2:34
thank you!!! :D
Original comment by cinthiac...@gmail.com
on 15 Jan 2013 at 6:28
Thank you very , It works for me
Original comment by Mai.k...@gmail.com
on 9 Oct 2013 at 8:44
[deleted comment]
Thank you so much!! T.T
It works for now~
Original comment by j...@bitts.co.kr
on 30 Sep 2014 at 11:42
Just saved me the time I would have spent to fix this function. Thank you very
much sir! My hat's off to you.
Original comment by mladjo2...@gmail.com
on 14 Aug 2015 at 12:09
Original issue reported on code.google.com by
npmar...@gmail.com
on 8 Jun 2009 at 6:16Attachments: