Skip to content

Read cell value  #1200

@QiiSyhx

Description

@QiiSyhx

This is:

- [ ] a bug report
- [ ] a feature request
- [ √] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

19101009372560839149

What is the current behavior?

1.9101009372561E+1

Cell {#624 ▼
  -value: "1.9101009372561E+19"
  -calculatedValue: null
  -dataType: "s"
  -parent: Cells {#569 ▶}
  -xfIndex: 0
  -formulaAttributes: null
}

What are the steps to reproduce?

$value=$sheet->getCell('A1')->getValue();
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

<?php

require __DIR__ . '/vendor/autoload.php';
 $file = IOFactory::load($file);
            $sheet = $file->getSheet(0);
            $rows = $sheet->getHighestRow();
$cell=$sheet->getCell('B3');
var_dump($cell->getValue());
// add code that show the issue here...

cell formatcode is General

Which versions of PhpSpreadsheet and PHP are affected?

PHP 7.1.17 (cli)
"phpoffice/phpspreadsheet": "^1.9"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions