Specify European Currency Column #2827

Open
opened 4 weeks ago by jazib17 · 3 comments

I am trying to generate an excel file in which a column should be treated as currency.
Now how can I specify column as European currency? Like European currency contains comma instead of decimal.
Example: 533.6 should be treated as 533,6

I am trying to generate an excel file in which a column should be treated as currency. Now how can I specify column as European currency? Like European currency contains comma instead of decimal. Example: 533.6 should be treated as 533,6
Owner

Thousands separator and decimal symbol are system settings. When exporting, use the normal en-US style (e.g. #,##0 or #,##0.00) and Excel automatically interprets the format using the regional settings. You can actually experiment by changing your system separators and watching Excel use the new settings.

Unfortunately the Excel formats have no way of marking the regional settings of the computer that last saved the file.

Thousands separator and decimal symbol are system settings. When exporting, use the normal en-US style (e.g. `#,##0` or `#,##0.00`) and Excel automatically interprets the format using the regional settings. You can actually experiment by changing your system separators and watching Excel use the new settings. Unfortunately the Excel formats have no way of marking the regional settings of the computer that last saved the file.
sheetjs closed this issue 4 weeks ago
jazib17 reopened this issue 4 weeks ago
Poster

Kindly tell me where do I specify the currency format for the column?

  exportexcel(): void {
    /* pass here the table id */
    const element = document.getElementById('excel-table');
    const ws: XLSX.WorkSheet = XLSX.utils.table_to_sheet(element, {dateNF: 'dd/mm/yyyy;@', cellDates: true, raw: true});

    /* generate workbook and add the worksheet */
    const wb: XLSX.WorkBook = XLSX.utils.book_new();
    XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');

    /* save to file */
    XLSX.writeFile(wb, this.fileName);

  }
Kindly tell me where do I specify the currency format for the column? ``` exportexcel(): void { /* pass here the table id */ const element = document.getElementById('excel-table'); const ws: XLSX.WorkSheet = XLSX.utils.table_to_sheet(element, {dateNF: 'dd/mm/yyyy;@', cellDates: true, raw: true}); /* generate workbook and add the worksheet */ const wb: XLSX.WorkBook = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); /* save to file */ XLSX.writeFile(wb, this.fileName); } ```
Owner

Remove raw: true. https://docs.sheetjs.com/docs/api/utilities#html-table-input -- for HTML tables, raw keeps the raw HTML strings while the default tries to parse values

Remove `raw: true`. https://docs.sheetjs.com/docs/api/utilities#html-table-input -- for HTML tables, `raw` keeps the raw HTML strings while the default tries to parse values
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2827
Loading…
There is no content yet.