Closed rafaelrinaldi closed 6 years ago
I'm having an issue where no matter if I specify :data-format it doesn't seem to get applied to the Excel file.
:data-format
(let [workbook (excel/create-workbook "test" [[91596]]) sheet (excel/select-sheet "test" workbook) cells (excel/cell-seq sheet) cell (nth cells 0) style (excel/create-cell-style! workbook {:data-format "#,##0"})] (excel/set-cell-style! cell style) (println cell) ;; #object[org.apache.poi.xssf.usermodel.XSSFCell 0x7594019e 91596.0] (println (-> style (.getDataFormatString))) ;; General (println (-> style (.getDataFormat))) ;; 0 (excel/save-workbook! "testing.xlsx" workbook))
As you can see from the logs, it doesn't seem to be being passed down at all.
91,596
91596
What am I doing wrong?
You are creating a cell with value 91596. Formatting applies to how it is displayed when you open the spreadsheet file in Excel, where it is displayed as expected with a thousand separator.
I'm having an issue where no matter if I specify
:data-format
it doesn't seem to get applied to the Excel file.As you can see from the logs, it doesn't seem to be being passed down at all.
91,596
91596
What am I doing wrong?