Merge pull request #240 from Kitzanos/fixed-parsing-issue-prod

Cherry-pick ( Fixed number parsing issue in application )
This commit is contained in:
Rinaldo
2025-03-10 13:00:57 +01:00
committed by GitHub

View File

@@ -63,8 +63,8 @@ public class FieldValidator {
if (value != null) { if (value != null) {
if(min!=null) { if(min!=null) {
if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) { if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) {
long numericValue = Long.parseLong(value); // Convert String to Long double numericValue = Double.parseDouble(value); // Use double instead of long
if (numericValue < min) { if (numericValue < min.doubleValue()) {
errors.add(MessageFormat.format( errors.add(MessageFormat.format(
Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MIN), fieldLabel, min)); Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MIN), fieldLabel, min));
} }
@@ -90,8 +90,8 @@ public class FieldValidator {
if (value != null) { if (value != null) {
if (max != null) { if (max != null) {
if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) { if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) {
long numericValue = Long.parseLong(value); // Convert String to Long double numericValue = Double.parseDouble(value); // Convert String to Long
if (numericValue > max) { if (numericValue > max.doubleValue()) {
errors.add(MessageFormat.format( errors.add(MessageFormat.format(
Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MAX), fieldLabel, max)); Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MAX), fieldLabel, max));
} }