diff --git a/classes/models/fields/FrmFieldNumber.php b/classes/models/fields/FrmFieldNumber.php index 6847e5c64c..91dd1a3dc7 100644 --- a/classes/models/fields/FrmFieldNumber.php +++ b/classes/models/fields/FrmFieldNumber.php @@ -113,8 +113,8 @@ protected function validate_step( &$errors, $args ) { $errors[ 'field' . $args['id'] ] = sprintf( // Translators: %1$s: the first nearest value; %2$s: the second nearest value. __( 'Please enter a valid value. Two nearest valid values are %1$s and %2$s', 'formidable' ), - floatval( $result[0] ), - floatval( $result[1] ) + is_numeric( $result[0] ) ? floatval( $result[0] ) : $result[0], + is_numeric( $result[1] ) ? floatval( $result[1] ) : $result[1] ); } @@ -127,7 +127,7 @@ protected function validate_step( &$errors, $args ) { * @param numeric $step The step. * @return array|int Return `0` if valid. Otherwise, return an array contains two nearest values. */ - private function check_value_is_valid_with_step( $value, $step ) { + protected function check_value_is_valid_with_step( $value, $step ) { // Count the number of decimals. $decimals = max( FrmAppHelper::count_decimals( $value ), FrmAppHelper::count_decimals( $step ) );