Adding a number-filled string to a cell adds an extra quote character at the beginning of the cell #3025
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#3025
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?
You can reproduse that on your own playground
https://docs.sheetjs.com/docs/api/utilities/array#array-of-arrays-input
In Chrome 118, the snippet generates the attached file.
The string value
'33333333333333333'
is serialized as a text cell. To distinguish between numbers and "strings that look like numbers", Excel displays the text cells with a leading apostrophe. It is not in the actual cell value.If the actual text value has an apostrophe, please share the file and find your browser version number. We can try to reproduce.
Windows 11
Version 119.0.6045.106 (Official Build) (64-bit)
Also this behavior can be reproduse on Node v20.9.0
How to force set cell format to 'Text' using sheet_add_aoa function?
You are highlighting a behavior of Excel.
Cell A1 is stored without an apostrophe:
That is saying cell A1 is an inline string with value "33333333333333333".
Excel displays the content with a leading apostrophe to visually distinguish strings like "333" from numbers like 333.
If you want to verify manually, enter
33333333333333333
in a cell and it will be converted to the number:Enter
'33333333333333333
in the next cell and it will be saved as text:If you select the cell, the formula bar will show the leading apostrophe.
You can set the number format of the cell to
@
:Using
sheet_add_aoa
, pass a cell object: