Jan 31, 2011 at 2:13 PM
Edited Jan 31, 2011 at 2:13 PM
The value you're getting from your database (291,083751927132) is not a PHP number, but a string containing a locale-formatted numeric value... recognisable by the comma (",") decimal separator rather than the
point ("."). When you do
with this value, then PHPExcel treats it as the string that it really is.
When you do
then PHPExcel casts the string to a numeric using standard PHP casting rules, which basically strips everything following the first non-numeric character... the comma (",").
You'll need to convert the string to a normal PHP floating-point value using something like:
$numberAsFloat = (float) str_replace(',','.',$row['CURRENT_VALUE']);
and then you can assign it to the cell normally