Fix rawNumber support inside sheet_to_json #2069

Closed
delesseps wants to merge 0 commits from master into master
delesseps commented 2020-07-23 00:30:14 +00:00 (Migrated from github.com)

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

Resolves #2068 and depends on a test_file being added via: [test_file PR](https://github.com/SheetJS/test_files/pull/11)
delesseps commented 2020-07-25 05:15:49 +00:00 (Migrated from github.com)

@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 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 commented 2020-07-29 17:42:25 +00:00 (Migrated from github.com)

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?

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?
geektcp (Migrated from github.com) reviewed 2020-09-13 14:15:25 +00:00
geektcp (Migrated from github.com) left a comment

LGTM

LGTM
JSilversun commented 2020-09-30 00:31:18 +00:00 (Migrated from github.com)

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

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 commented 2022-03-20 05:31:22 +00:00 (Migrated from github.com)

Thank you very much!

a5b387716c main repo commit

2571413d25 test files commit

Thank you very much! https://github.com/SheetJS/sheetjs/commit/a5b387716c2c3ec9b9794c5712a80f857e52a5d3 main repo commit https://github.com/SheetJS/test_files/commit/2571413d2560c1a41a73d9515e20aaac99c34570 test files commit

Pull request closed

Sign in to join this conversation.
No description provided.