From 0a10de5c18c0be9295a6ff29f347b91811e06823 Mon Sep 17 00:00:00 2001 From: Jan-Magnus Monenschein Date: Thu, 8 Feb 2024 13:12:36 +0100 Subject: [PATCH] fix: Correct data type 'number' constant to 'n' The official xlsx spec defines that the t property of a cell should have t='n' if the cell type is number. This also makes the exported Excel sheet work with LibreOffice correctly, since that expects 'n' as the type of number cell. Before, sheets exported with connected-workbooks and opened in LibreOffice calc would not display numbers in number cells at all. For Excel sheets, this does not change anything, since Excel understands 'n' as the type as well. Actually, '1' is a derivative from the spec, and it seems to be just per chance that Excel understands it. Therefore, I changed dataTypeKind.number from '1' to 'n'. --- .gitignore | 4 +++- src/utils/constants.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 635044a..e61d02a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ dist/ coverage/ # bundles -*.tgz \ No newline at end of file +*.tgz + +.idea \ No newline at end of file diff --git a/src/utils/constants.ts b/src/utils/constants.ts index dffb9e8..b432b0f 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -122,7 +122,7 @@ export const elementAttributes = { export const dataTypeKind = { string: "str", - number: "1", + number: "n", boolean: "b", };