Skip to content

Number prefixed with dollar sign is replaced when using rangeToArray #4242

@sirbaconjr

Description

@sirbaconjr

This is:

- [X] 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?

A cell that contains value like 200 number, $200 value that is formatted as Text should be recognized as 200 number - $200 value when using the rangeToArray function.

What is the current behavior?

The cell is being recognized as 200 number - 0 value.

What are the steps to reproduce?

<?php

require_once __DIR__ . '/../vendor/autoload.php';

$inputFileName = __DIR__ . '/../issue.dollar.sign.xlsx';
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
$sheet = $spreadsheet->getActiveSheet();

print_r($sheet->toArray());

issue.dollar.sign.xlsx

What features do you think are causing the issue

  • Reader
  • Writer
  • Styles
  • Data Validations
  • Formula Calculations
  • Charts
  • AutoFilter
  • Form Elements

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

XLS isn't affected.
XLSX is affected.

Which versions of PhpSpreadsheet and PHP are affected?

It seems all of them.

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