From 19df4ae392b2d9c6d77071aee475f6faebec8bfa Mon Sep 17 00:00:00 2001 From: David Dorchies <david.dorchies@inrae.fr> Date: Tue, 20 Feb 2024 16:20:40 +0000 Subject: [PATCH] fix(pab): loss of decimal separator when no more decimal remain Refs #662 --- src/app/components/pab-table/pab-table.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/components/pab-table/pab-table.component.ts b/src/app/components/pab-table/pab-table.component.ts index daa731730..27e95e86c 100644 --- a/src/app/components/pab-table/pab-table.component.ts +++ b/src/app/components/pab-table/pab-table.component.ts @@ -1011,10 +1011,11 @@ export class PabTableComponent implements AfterViewInit, AfterViewChecked, OnIni } public getCellValue(cell) { - if (typeof cell.model.singleValue === "string") { - cell.model.singleValue = +cell.model.singleValue; + if (typeof cell.model.singleValue === "string" && + cell.model.singleValue.slice(-1) !== ".") { + cell.model.singleValue = round(cell.model.singleValue, this.nDigits); } - return round(cell.model.singleValue, this.nDigits); + return cell.model.singleValue; } public setCellValue(cell, $event) { -- GitLab