intelica-library-ui 0.1.111 → 0.1.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3279,6 +3279,10 @@ class HtmlToExcelService {
|
|
|
3279
3279
|
const insertedRow = worksheet.addRow(rowValues);
|
|
3280
3280
|
insertedRow.eachCell((cell, colNumber) => {
|
|
3281
3281
|
const col = columns[colNumber - 1];
|
|
3282
|
+
if (col.formatNumber) {
|
|
3283
|
+
cell.numFmt = this.GetNumberFormat(col.formatNumber);
|
|
3284
|
+
cell.value = Number(cell.value);
|
|
3285
|
+
}
|
|
3282
3286
|
cell.alignment = {
|
|
3283
3287
|
vertical: "middle",
|
|
3284
3288
|
horizontal: col.alignHorizontal ?? "left",
|
|
@@ -3473,6 +3477,15 @@ class HtmlToExcelService {
|
|
|
3473
3477
|
}
|
|
3474
3478
|
return letter;
|
|
3475
3479
|
}
|
|
3480
|
+
GetNumberFormat(formatNumber) {
|
|
3481
|
+
const formats = {
|
|
3482
|
+
integer: '#,##0;(#,##0);"-"',
|
|
3483
|
+
decimal: '#,##0.00;(#,##0.00);"-"',
|
|
3484
|
+
percent_2: '#0.00"%";(#0.00"%");"-"',
|
|
3485
|
+
percent_4: '#0.0000"%";(#0.0000"%");"-"',
|
|
3486
|
+
};
|
|
3487
|
+
return formats[formatNumber] || "";
|
|
3488
|
+
}
|
|
3476
3489
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: HtmlToExcelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3477
3490
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: HtmlToExcelService, providedIn: "root" });
|
|
3478
3491
|
}
|