jasonrogena / jasonrogena/php-excel-reader

Wrong number format is applied? 19,90 turns into 20

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated Priority-Medium Type-Defect
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
What steps will reproduce the problem?

simply read and print out the data and see the problem at hand:
$data = new Spreadsheet_Excel_Reader("../../SandeliuLikuciai.xls");
$array=array('data'=>$data->sheets[0]['cells']);
unset($array['data'][1]);
print_r($array);

What is the expected output? What do you see instead?

Cell has number 19,90 (with format #.##0,00)
Reader gives me number 20, which I would get in Excel as well if I changed
number format to #.##0;-#.##0

Please provide any additional information below.
Attached a file that is being read. Checking lines 242 in the files, which have
cents after , sign
Problem is definitelly with numbar format, but can't seem to find how to fix
it, Please help

```

Original issue reported on code.google.com by `isgra...@gmail.com` on 27 Apr 2012 at 2:33

Attachments:
- [SandeliuLikuciai20120427.xls](https://storage.googleapis.com/google-code-attachments/php-excel-reader/issue-147/comment-0/SandeliuLikuciai20120427.xls)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached SandeliuLikuciai20120427.xls and inspect the cells around line 242, where the issue says values have cents after the comma. Read the number-format handling in Spreadsheet_Excel_Reader; done means a cell containing 19,90 is returned with its cents rather than rounded to 20.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.