Tuesday, October 4, 2022

[FIXED] How can I convert the value that more than 999 number in PHP Excel as number

Issue

I'm stuck with this for a few days about PHPExcel.

Why when it comes to 1000 the value convert to text automatically?

But It's normal if in the cell containing the number 0-999.

I have my code and the result below.

Thanks in advance.

image1 enter image description here


Solution

Please try this

$objPHPExcel->getActiveSheet()->getStyle('H'.$row)->getNumberFormat()->setFormatCode('#,##0.00');


Answered By - INTELLIZAP CONSULTING
Answer Checked By - Mary Flores (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.