33 public function validate( $name, $value, array $settings, array $options ) {
35 if ( !preg_match(
'/^[+-]?(?:\d*\.)?\d+(?:[eE][+-]?\d+)?$/D', $value ) ) {
36 $this->
failure(
'badfloat', $name, $value, $settings, $options );
40 if ( !is_finite( $ret ) ) {
41 $this->
failure(
'badfloat-notfinite', $name, $value, $settings, $options );
44 return $this->
checkRange( $ret, $name, $value, $settings, $options );
57 $localeData = localeconv();
58 if ( $localeData[
'decimal_point'] !==
'.' ) {
59 $value = strtr( $value, [
60 $localeData[
'decimal_point'] =>
'.',
63 $localeData[
'decimal_point'][0] =>
'.',
69 public function stringifyValue( $name, $value, array $settings, array $options ) {
71 $digits = defined(
'PHP_FLOAT_DIG' ) ? PHP_FLOAT_DIG : 15;
75 public function getHelpInfo( $name, array $settings, array $options ) {
76 $info = parent::getHelpInfo( $name, $settings, $options );