Fixed number parsing issue
This commit is contained in:
@@ -63,8 +63,8 @@ public class FieldValidator {
|
||||
if (value != null) {
|
||||
if(min!=null) {
|
||||
if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) {
|
||||
long numericValue = Long.parseLong(value); // Convert String to Long
|
||||
if (numericValue < min) {
|
||||
double numericValue = Double.parseDouble(value); // Use double instead of long
|
||||
if (numericValue < min.doubleValue()) {
|
||||
errors.add(MessageFormat.format(
|
||||
Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MIN), fieldLabel, min));
|
||||
}
|
||||
@@ -90,8 +90,8 @@ public class FieldValidator {
|
||||
if (value != null) {
|
||||
if (max != null) {
|
||||
if(contentResponseBean.getName().equals(GepafinConstant.NUMBER_INPUT)) {
|
||||
long numericValue = Long.parseLong(value); // Convert String to Long
|
||||
if (numericValue > max) {
|
||||
double numericValue = Double.parseDouble(value); // Convert String to Long
|
||||
if (numericValue > max.doubleValue()) {
|
||||
errors.add(MessageFormat.format(
|
||||
Translator.toLocale(GepafinConstant.VALIDATION_FIELD_MAX), fieldLabel, max));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user