31 public function validate( $name, $value, array $settings, array $options ) {
33 if ( !preg_match(
'/^[+-]?(?:\d*\.)?\d+(?:[eE][+-]?\d+)?$/D', $value ) ) {
38 if ( !is_finite( $ret ) ) {
55 $localeData = localeconv();
56 if ( $localeData[
'decimal_point'] !==
'.' ) {
57 $value = strtr( $value, [
58 $localeData[
'decimal_point'] =>
'.',
61 $localeData[
'decimal_point'][0] =>
'.',
67 public function stringifyValue( $name, $value, array $settings, array $options ) {
69 $digits = defined(
'PHP_FLOAT_DIG' ) ? PHP_FLOAT_DIG : 15;