12 return $this->mParams[
'size'] ?? 20;
16 $p = parent::validate( $value, $alldata );
22 $value = trim( $value ??
'' );
25 # with the addition that a leading '+' sign is ok.
26 if ( !preg_match(
'/^((\+|\-)?\d+(\.\d+)?(E(\+|\-)?\d+)?)?$/i', $value ) ) {
27 return $this->
msg(
'htmlform-float-invalid' );
30 # The "int" part of these message names is rather confusing.
31 # They make equal sense for all numbers.
32 if ( isset( $this->mParams[
'min'] ) ) {
33 $min = $this->mParams[
'min'];
35 if ( $min > $value ) {
36 return $this->
msg(
'htmlform-int-toolow', $min );
40 if ( isset( $this->mParams[
'max'] ) ) {
41 $max = $this->mParams[
'max'];
43 if ( $max < $value ) {
44 return $this->
msg(
'htmlform-int-toohigh', $max );
56 return new \OOUI\NumberInputWidget(
$params );
61class_alias( HTMLFloatField::class,
'HTMLFloatField' );
array $params
The job parameters.