Maintaining the cells currency format during the export to an Excel file. #2886

Open
opened 2023-02-16 20:31:55 +00:00 by Goliath · 1 comment

I have this code that exports my table to an Excel file:

const SHEET = XLSX.utils.table_to_sheet(tableElement, {
	'raw': false,
	'cellNF': true
});

In my table, I have cells with this value:

$887,112.00

So I can export the currency as an actual number on the Excel file, but lost the currency sign. How would I set the maintain currency format in the export without tweaking any of the table cell's attributes?

I have this code that exports my table to an Excel file: ``` const SHEET = XLSX.utils.table_to_sheet(tableElement, { 'raw': false, 'cellNF': true }); ``` In my table, I have cells with this value: $887,112.00 So I can export the currency as an actual number on the Excel file, but lost the currency sign. How would I set the maintain currency format in the export without tweaking any of the table cell's attributes?
Owner

If you can't tweak, you can read with raw: true and try to parse the individual text entries. We will investigate more robust value parsing.

If you can tweak, https://docs.sheetjs.com/docs/api/utilities#value-override

For your example:

<td data-t="n" data-v="887112.00" data-z="$#,##0.00">$887,112.00</td>
If you can't tweak, you can read with `raw: true` and try to parse the individual text entries. We will investigate more robust value parsing. If you can tweak, https://docs.sheetjs.com/docs/api/utilities#value-override For your example: ```html <td data-t="n" data-v="887112.00" data-z="$#,##0.00">$887,112.00</td> ```
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2886
No description provided.