SheetJS / sheetjs

📗 SheetJS Spreadsheet Data Toolkit -- New home https://git.sheetjs.com/SheetJS/sheetjs
https://sheetjs.com/
Apache License 2.0
34.95k stars 8k forks source link

Grinding rawNumbers to separate options #2749

Open PavelKoroteev opened 2 years ago

PavelKoroteev commented 2 years ago

I have issue with some number column in excel with custom formatting, whose do display the same as General format in Excel Viewer, but whose add $ prefix to csv value, when I get cvs from this file.

[$-ru-RU]0

With

rawNumbers: true

I successful get just number from number cell (get cell.v instead of cell.w).

But I have issue from date field, whose with this option returned as numbers.

Should we do more clarify options for this case?

SheetJSDev commented 2 years ago

Under the hood, Excel actually stores numbers. The number format is what makes values act like dates.

If the origin of the worksheet is a file (you called read or readFile somewhere), you should be able to pass the option cellDates: true to keep date objects rather than the date codes.