Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify XLSX RW to keep decimal for floats with a zero decimal part #1262

Closed
wants to merge 1 commit into from
Closed

Modify XLSX RW to keep decimal for floats with a zero decimal part #1262

wants to merge 1 commit into from

Conversation

rtek
Copy link
Contributor

@rtek rtek commented Nov 25, 2019

This is:

  • a bugfix

Why this change is needed?

Prior to 1.10, all numeric values where read as floats. In 1.10
numeric values are read using 0 + x, which relies on PHP type
juggling rules. As a result, float(0.0) is written as string('0'),
then read back as int(0). This fix causes the writer to retain the
the decimal for float values such that a reader can differentiate
floats from ints.

Checklist:

Prior to 1.10, all numeric values where read as floats. In 1.10
numeric values are read using 0 + x, which relies on PHP type
juggling rules. As a result, float(0.0) is written as string('0'),
then read back as int(0). This fix causes the writer to retain the
the decimal for float values such that a reader can differentiate
floats from ints.
@PowerKiKi PowerKiKi closed this in cf30c2a Nov 30, 2019
@PowerKiKi
Copy link
Member

Thanks for this great PR !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants