X Tutup
The Wayback Machine - https://web.archive.org/web/20201125094442/https://github.com/SheetJS/sheetjs/pull/2069
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

Fix rawNumber support inside sheet_to_json #2069

Open
wants to merge 2 commits into
base: master
from

Conversation

@delesseps
Copy link

@delesseps delesseps commented Jul 23, 2020

Resolves #2068 and depends on a test_file being added via: test_file PR

delesseps added 2 commits Jul 23, 2020
@delesseps
Copy link
Author

@delesseps delesseps commented Jul 25, 2020

@SheetJSDev I believe this fixes a problem that was recently added in #2014. cc @ab320012 Please let me know if it seems ok. As mentioned I added a related test file that needs to be merged for the tests to pass.

@SheetJSDev
Copy link
Contributor

@SheetJSDev SheetJSDev commented Jul 29, 2020

Let's start from scratch. @delesseps suppose none of these options existed. What would be the appropriate options and defaults? Here are the main considerations:

  1. Dates may be represented as date objects or as Excel Date Codes with appropriate number format, so there probably should be an option to control how dates and date-like numbers are processed

  2. Excel separates "content" (raw value) from "presentation" (displayed text), so there probably should be an option to control whether the function returns the raw values or the formatted text

Questions:

  • Should the content/presentation issue be adjustable at the cell type level (number, date, string, boolean, error) or should it be a single option (like raw currently)?

  • What is the appropriate default behavior when a worksheet has both true date cells (type d) and date-like numbers (type n with a date number format)? Should it try to normalize as dates, normalize as numbers, or leave as-is?

@SheetJSDev SheetJSDev force-pushed the SheetJS:master branch from 0786b99 to 3b589f0 Aug 12, 2020
Copy link

@geektcp geektcp left a comment

LGTM

@JSilversun
Copy link

@JSilversun JSilversun commented Sep 30, 2020

Hello, I'm parsing big excel files and I would like to get the numbers as a raw string to prevent conversions to javascript Number object to prevent any kind of precision loss, is it possible to parse an excel file to JSON and read the values as raw strings but with all decimals? Thank you

@SheetJSDev SheetJSDev force-pushed the SheetJS:master branch from 4254ed4 to eec93b0 Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.
X Tutup