phpexcel how get cell format

[亡魂溺海] 提交于 2020-01-30 08:43:11

问题


How I can get cell format? I Try

$E->getActiveSheet()->getCellByColumnAndRow(0, 24)->getCalculatedValue()

but it rerurns '6', I need '6 бухта' (sorry for russian letters)


回答1:


$E->getActiveSheet()->getCellByColumnAndRow(0, 24)
    ->getFormattedValue()



回答2:


you can get the cell format by code,

var_dump($objPHPExcel->getActiveSheet()->getCell('D3')->getStyle()->getNumberFormat()->getFormatCode());

and output will be like:

string(8) "mm-dd-yy"



来源:https://stackoverflow.com/questions/15722801/phpexcel-how-get-cell-format

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!