Closed wengkiat closed 7 years ago
Testet with PHP7 on Win - not reproducible. I think $row[$param]
is of type string and needs to be casted to float first.
$excel = new \ExcelBook();
$xlsSheet = new \ExcelSheet($excel, 'test');
$numFormat = new \ExcelFormat($excel);
$numFormat->numberFormat(\ExcelFormat::NUMFORMAT_GENERAL);
$xlsSheet->write(2, 1, 100, $numFormat);
$excel->save('foo.xls');
@johmue , alright casting to float did fix the problem, thanks!
Hi,
I am creating an excel and have used :
$numFormat = new \ExcelFormat($excel); $numFormat->numberFormat(\ExcelFormat:: NUMFORMAT_GENERAL); $xlsSheet->write($rowNumber, $colNum, $row[$param], $numFormat);
But my value filled into the excel is text instead of a number, i would like a number.
I have tried: NUMFORMAT_NUMBER NUMFORMAT_TEXT
Please advise, thanks!