Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit c282dff

Browse files
committed
refactor: cast to number
1 parent e0f7b53 commit c282dff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/app/modules/angular-slickgrid/services/__tests__/excelExport.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,9 +1024,9 @@ describe('ExcelExportService', () => {
10241024
],
10251025
['Order: 20 (2 items)'],
10261026
['Last Name: Z (1 items)'],
1027-
['', '1E06', 'John', 'Z', 'Sales Rep.', { metadata: { style: 3 }, value: '10', }],
1027+
['', '1E06', 'John', 'Z', 'Sales Rep.', { metadata: { style: 3, type: 'number' }, value: 10, }],
10281028
['Last Name: Doe (1 items)'],
1029-
['', '2B02', 'Jane', 'DOE', 'Finance Manager', { metadata: { style: 3 }, value: '10', }],
1029+
['', '2B02', 'Jane', 'DOE', 'Finance Manager', { metadata: { style: 3, type: 'number' }, value: 10, }],
10301030
['Last Name: null (0 items)'],
10311031
['', '', '', '', '', '20'],
10321032
['', '', '', '', '', '10'],

src/app/modules/angular-slickgrid/services/excelExport.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class ExcelExportService {
252252
}
253253
break;
254254
case FieldType.number:
255-
const val = isNaN(+data) ? null : data;
255+
const val = isNaN(+data) ? null : +data;
256256
outputData = { value: val, metadata: { style: this._stylesheetFormats.numberFormatter.id } };
257257
break;
258258
default:

0 commit comments

Comments
 (0)