public function reverseTransform($value)
    {
        if (!is_scalar($value)) {
            throw new TransformationFailedException('Expected a scalar.');
        }

        if ('' === $value) {
            return null;
        }

        $result = $value;

        if (!is_numeric($result)) {
            throw new TransformationFailedException('Value is not numeric.');
        }

        if (\is_string($result)) {
            if (false !== mb_strpos($result, '.')) {
                $result = (float) $result;
            } else {
                $result = (int) $result;
            }
        }

        if ($result >= PHP_INT_MAX || $result <= -PHP_INT_MAX) {
            throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like.');
        }

        return $this->round($result);
    }
public function reverseTransform($value)
    {
        if (!is_scalar($value)) {
            throw new TransformationFailedException('Expected a scalar.');
        }

        if ('' === $value) {
            return null;
        }

        $result = $value;

        if (!is_numeric($result)) {
            throw new TransformationFailedException('Value is not numeric.');
        }

        if (\is_string($result)) {
            if (false !== mb_strpos($result, '.')) {
                $result = (float) $result;
            } else {
                $result = (int) $result;
            }
        }

        if ($result >= PHP_INT_MAX || $result <= -PHP_INT_MAX) {
            throw new TransformationFailedException('I don\'t have a clear idea what infinity looks like.');
        }

        return $this->round($result);
    }
public function reverseTransform ( $ value ) { if ( ! is_scalar ( $ value ) ) { throw new TransformationFailedException ( 'Expected a scalar.' ) ; } if ( '' === $ value ) { return null ; } $ result = $ value ; if ( ! is_numeric ( $ result ) ) { throw new TransformationFailedException ( 'Value is not numeric.' ) ; } if ( \ is_string ( $ result ) ) { if ( false !== mb_strpos ( $ result , '.' ) ) { $ result = ( float ) $ result ; } else { $ result = ( int ) $ result ; } } if ( $ result >= PHP_INT_MAX || $ result <= - PHP_INT_MAX ) { throw new TransformationFailedException ( 'I don\'t have a clear idea what infinity looks like.' ) ; } return $ this -> round ( $ result ) ; }
Transforms a normalized number into an integer or float.

@param string $value The localized value

@throws TransformationFailedException If the given value is not a string
or if the value can not be transformed

@return int|float|null The numeric value
Transforms a normalized number into an integer or float .