From bf320417ceacf4274961632152af2a468bb221b0 Mon Sep 17 00:00:00 2001 From: mozzy11 Date: Tue, 18 Jun 2024 17:08:58 +0300 Subject: [PATCH 1/2] Fix test Calculated --- README.md | 4 ++-- .../admin/calculatedValue/CalculatedValueForm.tsx | 1 + .../action/util/TestCalculatedUtil.java | 12 +++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3381564369..ee47318117 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ accessing any of these links, simply follow these steps: cd frontend npm run format -2. After making changes to the [backend](./src/) directory, run the formatter to - properly format the Java code +2. After making changes to the [backend](./src/) directory, run the formatter + to properly format the Java code mvn clean install -P format diff --git a/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx b/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx index 7beeba08b4..ed50be7b0d 100644 --- a/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx +++ b/frontend/src/components/admin/calculatedValue/CalculatedValueForm.tsx @@ -477,6 +477,7 @@ const CalculatedValue: React.FC = () => { name="value" type="number" id={index + "_" + operationIndex + "_integer"} + step="any" labelText={ } diff --git a/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java b/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java index cd6c5e4089..7548820830 100644 --- a/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java +++ b/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java @@ -172,7 +172,17 @@ public List addNewTestsToDBForCalculatedTests( Operation.OperationType.TEST_RESULT.toString()); break; case INTEGER: - function.append(Integer.valueOf(operation.getValue())).append(" "); + try { + if (operation.getValue().contains(".")) { + double val = Double.parseDouble(operation.getValue()); + function.append(val).append(" "); + } else { + int number = Integer.parseInt(operation.getValue()); + function.append(number).append(" "); + } + } catch (NumberFormatException e) { + + } break; case MATH_FUNCTION: if (operation.getValue().equals(Operation.IN_NORMAL_RANGE)) { From 587fc14c8f43c3d6c126875c20c0270827e9a2f8 Mon Sep 17 00:00:00 2001 From: mozzy11 Date: Tue, 18 Jun 2024 17:17:06 +0300 Subject: [PATCH 2/2] bump fix version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dd96143a12..ae731562e7 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ 8 1 - 34 + 35 UTF-8 ${project.basedir}/liquibase/liquibase.properties 1.4.1