Skip to content

Commit 7c2e38e

Browse files
fix(datagrid-web): replace excelStringFormat with excelString for consistency in cell formatting
1 parent f2de966 commit 7c2e38e

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

packages/pluggableWidgets/datagrid-web/src/features/data-export/DSExportRequest.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ const readers: ReadersByType = {
304304
exportNumberFormat: props.exportNumberFormat
305305
});
306306

307-
return excelStringFormat(data.value ?? "", format);
307+
return excelString(data.value ?? "", format);
308308
case "unavailable":
309309
return excelString("n/a");
310310
default:
@@ -320,7 +320,7 @@ const readers: ReadersByType = {
320320
exportNumberFormat: props.exportNumberFormat
321321
});
322322

323-
return excelStringFormat(value, format);
323+
return excelString(value, format);
324324
}
325325
};
326326

@@ -336,18 +336,11 @@ function excelNumber(value: number, format?: string): ExcelCell {
336336
};
337337
}
338338

339-
function excelString(value: string): ExcelCell {
340-
return {
341-
t: "s",
342-
v: value
343-
};
344-
}
345-
346-
function excelStringFormat(value: string, format?: string): ExcelCell {
339+
function excelString(value: string, format?: string): ExcelCell {
347340
return {
348341
t: "s",
349342
v: value,
350-
z: format
343+
z: format ?? undefined
351344
};
352345
}
353346

0 commit comments

Comments
 (0)