static function TryParse($string, &$result) {
        $result = null;
        $strNumber = trim($string);
        $decPoint = self::$_separator1;
        $thousandSep = self::$_separator2;
        if (!self::EvaluateSeparators($strNumber, $decPoint, $thousandSep)){
            return false;
        }
        
        $strFiltered = preg_replace("/[^0-9\.\,\-\+]/" , "" , $strNumber);
        $strPrepared = str_replace($thousandSep, '', $strFiltered);
        $strNormalized = str_replace($decPoint, '.', $strPrepared);
        $result = floatval($strNormalized);
        return true;
    }
static function TryParse($string, &$result) {
        $result = null;
        $strNumber = trim($string);
        $decPoint = self::$_separator1;
        $thousandSep = self::$_separator2;
        if (!self::EvaluateSeparators($strNumber, $decPoint, $thousandSep)){
            return false;
        }
        
        $strFiltered = preg_replace("/[^0-9\.\,\-\+]/" , "" , $strNumber);
        $strPrepared = str_replace($thousandSep, '', $strFiltered);
        $strNormalized = str_replace($decPoint, '.', $strPrepared);
        $result = floatval($strNormalized);
        return true;
    }
static function TryParse ( $ string , & $ result ) { $ result = null ; $ strNumber = trim ( $ string ) ; $ decPoint = self :: $ _separator1 ; $ thousandSep = self :: $ _separator2 ; if ( ! self :: EvaluateSeparators ( $ strNumber , $ decPoint , $ thousandSep ) ) { return false ; } $ strFiltered = preg_replace ( "/[^0-9\.\,\-\+]/" , "" , $ strNumber ) ; $ strPrepared = str_replace ( $ thousandSep , '' , $ strFiltered ) ; $ strNormalized = str_replace ( $ decPoint , '.' , $ strPrepared ) ; $ result = floatval ( $ strNormalized ) ; return true ; }
Parses the number globally. Note that Strings like 1.000 or 1,000 will lead to 1.0 as result, while 1.000.000 or 1,000,000 will result in 1 millionen.
@param string $string The numerich string
@param float $result The result, or null if no parsing possible
@return boolean Returns true if number could be parsed
Parses the number globally . Note that Strings like 1 . 000 or 1 000 will lead to 1 . 0 as result while 1 . 000 . 000 or 1 000 000 will result in 1 millionen .