jasonrogena / jasonrogena/php-excel-reader
rounding on some decimal numbers
- Dominant language
- PHP
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
```
What steps will reproduce the problem?
1. When you have to read a certain excel file, the function _getCellDetails
format a decimal number and the format is like 0.0000 , the variable of format
is read or has a numeric type; changing the format of the variable to string
fixes de rounding resulting number.
What is the expected output? What do you see instead?
a decimal number , rounded number
example; expected 6.96000 , see instead: 7.77777
Please provide any additional information below.
I fixex, in this way:
version 2.21
function _getCellDetails
after line: 1633; I added this:
if($format==0.00000 ){
$format="0.00000";
}
```
Original issue reported on code.google.com by `fabinner...@gmail.com` on 19 Apr 2012 at 2:58
Attachments:
- [excel_reader2.php](https://storage.googleapis.com/google-code-attachments/php-excel-reader/issue-146/comment-0/excel_reader2.php)
- [TablaDeCotizaciones_bnb_2012_04_18.xls](https://storage.googleapis.com/google-code-attachments/php-excel-reader/issue-146/comment-0/TablaDeCotizaciones_bnb_2012_04_18.xls)
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect the attached excel_reader2.php around _getCellDetails and line 1633, then reproduce the issue with TablaDeCotizaciones_bnb_2012_04_18.xls. Compare the parsed format and resulting decimal value with the reported expected output. Done means the affected decimal formatting no longer produces the incorrect rounded number.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100