【问题标题】:Converting the digit from Number format to Scientific Notation is wrong将数字从数字格式转换为科学记数法是错误的
【发布时间】:2018-02-15 06:07:15
【问题描述】:

[A1] = 2519121152247150000000

$data = $worksheet->getCellByColumnAndRow(1, 1)->getValue()

返回$data = 2.51912115225E+21

但必须是$data = 2.51912115224715E+21

【问题讨论】:

  • 您在 php.ini 中的精度设置是多少?
  • 请注意,您也可能会发现 32 位 PHP 和 64 位 PHP 之间的区别
  • 64 位版本的 PHP,i am using this function to check
  • 然后检查您在php.ini 中的precision 设置...我怀疑它设置为12,如果您将其更改为14,那么您将显示所有这些数字...。 demo
  • @MarkBaker 你是最棒的!!它的工作:D precicion = 12 in php.ini 我改变它,它的工作谢谢!

标签: php excel phpspreadsheet


【解决方案1】:

感谢@MarkBaker

然后检查 php.ini 中的精度设置...。我怀疑它设置为 12,如果将其更改为 14,那么您将显示所有这些数字....

DEMO from @MarkBaker

【讨论】:

    猜你喜欢
    • 2017-04-01
    • 2021-12-23
    • 1970-01-01
    • 2020-08-02
    • 2022-10-06
    • 1970-01-01
    • 2019-04-22
    • 1970-01-01
    • 2017-11-27
    相关资源
    最近更新 更多