Large Number value converting it to exponential Numbers #3053
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#3053
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Large Number value converting it to exponential Numbers used
{row = true in sheet_to_json method and dateNF: 'yyyy-mm-dd' } the reason is i need date in the yyy-mm-dd and large number let say 18 digits number .
in XLSXSample.utils.sheet_to_json method :-
**if i give raw = false ,dateNF: 'yyyy-mm-dd', , large number shows exponential number for 1234567891089760 it is giving '1.23457E+15' , and yes date is giving correct format as i mentioned in the dateNF.
if i give raw = true ,dateNF: 'yyyy-mm-dd', then then Date is taking text / string format
ex: Fri Jan 05 1990 23:59:50 GMT+0530 (India Standard Time) and largenumber number showing correct ,**
how to fix this in both column Date and ID number ,
FYI: Id number holds 18 digit number and Date holds Date data.
Please read the following pages in the documentation first:
readFile
)sheet_to_json
)The following explanation should be clear if you have read the documentation. If not, please let us know how the docs can be improved.
For each case, you should set
cellDates: true
when reading the fileIf you want numbers and dates to be stringified according to Excel rules, set the following options in
sheet_to_json
:raw: false
If you want numbers to be stringified but Dates to be passed back as date objects, set the following options in
sheet_to_json
:rawNumbers: false
If you want dates to be stringified but numbers to be passed back as raw values, set the following options in
sheet_to_json
:raw: false, rawNumbers: true
If you want numbers and dates to be passed back as raw values, do not set either option (or set both to
true
)Excel "General" format uses exponential for your case.
If the file itself is using "General" but you want to force "0" format, you can loop through the relevant cells and set the number format / delete the old formatted text.
thank you