PHP: How can I get data in string format from Excel data with scientific notation / exponential format?

I have a project in Yii2 that uses the PHPExcel library to read an Excel file. I have a Transaction Id column containing data in a general format cell. Screenshot of my Excel file: enter image description here

You can see above if I entered 15 characters of a number and put two dots in it. It will be displayed as a number.

First Ex : Input => 800.003.151476962 in the cell shown as image in the formula table is shown as image

But if you enter 15 characters of a number without dots inside, it will be displayed as Scientific notation / Exponential .

Ex: Input = > 800003151476925 , image = > / image

PHP, PHP Second Ex Scientific Notation/Exponential //.

Ex 800003151476925 ( , ), 8.00003E + 14 PHP?

:)

. PHP, php, php, .

+4
1

2 ( ) , ; MS Excel General ( MS Excel) . ( ) PHPExcel ; MS Excel , MS Excel General , 32- , float.

, , setCellValueExplicit(), ; , General, 0

$objPHPExcel->getActiveSheet()->getStyle('A9')
    ->getNumberFormat()
    ->setFormatCode(
        '0'
    );
+5

Source: https://habr.com/ru/post/1667521/


All Articles