3 declare(strict_types=1);
32 private const REG_STRING =
'/^\s*(-?(0|([1-9]\d*)))([.,]\d*)?\s*$/';
40 if ($from !== INF && $from !== -INF && is_float($from) && !is_nan($from)) {
52 if (is_string($from)) {
53 $preg_match_string = preg_match(self::REG_STRING, $from, $RegMatch);
54 if ($preg_match_string) {
55 return (
float) str_replace(
',',
'.', $from);
58 $preg_match_floating_string = preg_match(self::REG_STRING_FLOATING, $from, $RegMatch);
59 if ($preg_match_floating_string) {
64 sprintf(
'The value "%s" could not be transformed into an float', var_export($from,
true)),
71 sprintf(
'The value "%s" could not be transformed into an float', var_export($from,
true)),
trait DeriveApplyToFromTransform
trait DeriveInvokeFromTransform
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...