Export xlsx file with a "number" cell format #966
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#966
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
I really enjoy working with this lib. really great work !

As mentioned in the title im exporting an excel file from an array of arrays and would like to change the cell format from "standard" to "number"
any idea how ca i achieve that please. thanks a lot!
Unfortunately the utility doesn't have an option to set the format for a column, but you can manually walk the cells:
Number formats are stored in the
.z
property of cell objects. The standard number format is"0.00"
(2 decimal places, no thousands separator) in US English and is probably the same in French. You can verify by saving a file with the number format, reading the file in http://oss.sheetjs.com/js-xlsx/ and inspecting theglobal_wb
object in your console.To manually change cells, use a walk similar to the README example:
Here's a live example: https://jsfiddle.net/1ny97xrb/1/
@sheetjsdev: eventually
aoa_to_sheet
should take a header type specificationthanks for the answer ! I'll try it ASAP
Really useful answer from @reviewher. The only thing I could not figure out was how to format the entire column instead of the individual cells? If anyone has a suggestion, I would be very grateful...
Thank you very much...
You have saved my life with your solution. :)