private function createAmountFromStr($amountString)
    {
        // Decimal mark style (UK/US): 000.00 or 0,000.00
        if (preg_match('/^(-|\+)?([\d,]+)(\.?)([\d]{2})$/', $amountString) === 1) {
            return (float)preg_replace(
                ['/([,]+)/', '/\.?([\d]{2})$/'],
                ['', '.$1'],
                $amountString
            );
        }

        // European style: 000,00 or 0.000,00
        if (preg_match('/^(-|\+)?([\d\.]+,?[\d]{2})$/', $amountString) === 1) {
            return (float)preg_replace(
                ['/([\.]+)/', '/,?([\d]{2})$/'],
                ['', '.$1'],
                $amountString
            );
        }

        return (float)$amountString;
    }
private function createAmountFromStr($amountString)
    {
        // Decimal mark style (UK/US): 000.00 or 0,000.00
        if (preg_match('/^(-|\+)?([\d,]+)(\.?)([\d]{2})$/', $amountString) === 1) {
            return (float)preg_replace(
                ['/([,]+)/', '/\.?([\d]{2})$/'],
                ['', '.$1'],
                $amountString
            );
        }

        // European style: 000,00 or 0.000,00
        if (preg_match('/^(-|\+)?([\d\.]+,?[\d]{2})$/', $amountString) === 1) {
            return (float)preg_replace(
                ['/([\.]+)/', '/,?([\d]{2})$/'],
                ['', '.$1'],
                $amountString
            );
        }

        return (float)$amountString;
    }
private function createAmountFromStr ( $ amountString ) { // Decimal mark style (UK/US): 000.00 or 0,000.00 if ( preg_match ( '/^(-|\+)?([\d,]+)(\.?)([\d]{2})$/' , $ amountString ) === 1 ) { return ( float ) preg_replace ( [ '/([,]+)/' , '/\.?([\d]{2})$/' ] , [ '' , '.$1' ] , $ amountString ) ; } // European style: 000,00 or 0.000,00 if ( preg_match ( '/^(-|\+)?([\d\.]+,?[\d]{2})$/' , $ amountString ) === 1 ) { return ( float ) preg_replace ( [ '/([\.]+)/' , '/,?([\d]{2})$/' ] , [ '' , '.$1' ] , $ amountString ) ; } return ( float ) $ amountString ; }
Create a formatted number in Float according to different locale options

Supports:
000,00 and -000,00
0.000,00 and -0.000,00
0,000.00 and -0,000.00
000.00 and 000.00

@param  string $amountString
@return float
Create a formatted number in Float according to different locale options