public function parseInteger($string)
    {
        $value = null;

        $lc = $this->getLocaleInfo();

        $string = $this->parseNegativeNotation($string);

        $search = array($lc['thousands_sep'], $lc['positive_sign'], ' ');

        $replace = array('', '', '');

        $string = str_replace($search, $replace, $string);

        if (is_numeric($string)) {
            if ($string > (float) PHP_INT_MAX) {
                throw new SwatIntegerOverflowException(
                    'Floating point value is too big to be an integer',
                    null,
                    1
                );
            }

            if ($string < (float) (-PHP_INT_MAX - 1)) {
                throw new SwatIntegerOverflowException(
                    'Floating point value is too small to be an integer',
                    null,
                    -1
                );
            }

            $value = intval($string);
        }

        return $value;
    }