From 7c6ae459d7909cda132a2f484adf2a09e8e5dbed Mon Sep 17 00:00:00 2001 From: Thang PHAM Date: Tue, 15 Oct 2024 08:47:39 +0200 Subject: [PATCH 1/3] [FIX] Rounding problem in modification by formula with 100 percentage --- .../server/modifications/byfilter/ByFormulaModification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java b/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java index d8071d983..ad35e95db 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java @@ -105,7 +105,7 @@ private Double applyOperation(Operator operator, @Nonnull Double value1, @Nonnul case SUBTRACTION -> value1 - value2; case MULTIPLICATION -> value1 * value2; case DIVISION -> value1 / value2; - case PERCENTAGE -> value1 * (value2 / 100); + case PERCENTAGE -> (value1 / 100) * value2; }; } } From 654c4dbae800a2a75cf738658bab2de5ddae27a9 Mon Sep 17 00:00:00 2001 From: Thang PHAM Date: Tue, 15 Oct 2024 09:21:51 +0200 Subject: [PATCH 2/3] [FIX] Rounding problem in modification by formula with 100 percentage --- .../server/modifications/byfilter/ByFormulaModification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java b/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java index ad35e95db..0ce303960 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java @@ -105,7 +105,7 @@ private Double applyOperation(Operator operator, @Nonnull Double value1, @Nonnul case SUBTRACTION -> value1 - value2; case MULTIPLICATION -> value1 * value2; case DIVISION -> value1 / value2; - case PERCENTAGE -> (value1 / 100) * value2; + case PERCENTAGE -> (value1 * value2) / 100; }; } } From e3a7c4c866bdd9c8248c1fc53db0a3c8a64f75d3 Mon Sep 17 00:00:00 2001 From: Thang PHAM Date: Tue, 15 Oct 2024 09:58:58 +0200 Subject: [PATCH 3/3] [FIX] Rounding problem in modification by formula with 100 percentage --- .../server/modifications/byfilter/ByFormulaModification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java b/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java index 0ce303960..ad35e95db 100644 --- a/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java +++ b/src/main/java/org/gridsuite/modification/server/modifications/byfilter/ByFormulaModification.java @@ -105,7 +105,7 @@ private Double applyOperation(Operator operator, @Nonnull Double value1, @Nonnul case SUBTRACTION -> value1 - value2; case MULTIPLICATION -> value1 * value2; case DIVISION -> value1 / value2; - case PERCENTAGE -> (value1 * value2) / 100; + case PERCENTAGE -> (value1 / 100) * value2; }; } }