SwatI18N/SwatI18NLocale.php
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;
    }
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;
    }
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 ; }
Parses a numeric string formatted for this locale into an integer number

If the string has fractional digits, the returned integer value is
rounded according to the rounding rules for
{@link http://php.net/manual/en/function.intval.php intval()}.

Note: The number does not have to be formatted exactly correctly to be
parsed. Checking too closely how well a formatted number matches its
locale would be annoying for users. For example, '1000' should not be
rejected because it wasn't formatted as '1,000'.

If the number is too large to fit in PHP's integer range (depends on
system architecture), an exception is thrown.

@param string $string the formatted string.

@return integer the numeric value of the parsed string. If the given
value could not be parsed, null is returned.

@throws SwatIntegerOverflowException if the converted number is too large
to fit in an integer or if the converted number is too
small to fit in an integer.
Parses a numeric string formatted for this locale into an integer number