search

Home  >  Q&A  >  body text

phpexcel imports data expressed in scientific notation

Recently, there has been a problem with using phpexcel to import excel tables (excel2007). If the numbers in the table are too long, excel will sometimes express them in scientific notation. During the import, the data table will also store the data in scientific notation. If the cell number is expressed in zip code, although it is expressed as a long number on the excel sheet, it will still be expressed in scientific notation when imported into the data table.

I have tried adding string and getFormattedValue() in front of the $objPHPExcel object but it cannot be changed. How should I solve it without processing the excel table? .

Originally, I was thinking about how to deal with this situation when a customer encounters it. . But it seems that the phpexcel object passed in is already a character in scientific notation, and even if it is number_format, it cannot be converted back to the previous number. . We can only ask the customer to deal with it first. .

習慣沉默習慣沉默2747 days ago1415

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-24 11:35:34

    I just add a single quote at the front.

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-24 11:35:34

    number_format

    $num = 1.00E+36;
    var_dump($num);
    var_dump(number_format($num));    //返回的是string类型

    reply
    0
  • Cancelreply