diff --git a/src/Format.php b/src/Format.php index eff2b0d..4336ff1 100644 --- a/src/Format.php +++ b/src/Format.php @@ -270,13 +270,13 @@ public static function value( /** - * @template T of scalar|null + * @template T of mixed * @param T $value * @return ($strict is true ? int|float|null : T) */ public static function numeric(mixed $value, ?int $precision = null, bool $strict = true): mixed { - $number = strtr(strval($value), [' ' => '', ',' => '.']); + $number = strtr(static::stringify($value), [' ' => '', ',' => '.']); if (!$number || !is_numeric($number)) { return $strict ? null : $value;