private static function parsePercent($input, &$result)
    {
        // Detect and remove percent sign
        if (preg_match('/^\\s*(\\d*(?:\\.\\d*)?)%\\s*$/', $input, $matches)) {
            $result = floatval($matches[1]) / 100;
            
            if ($result < 0) $result = 0;
            if ($result > 1) $result = 1;
            
            return true;
        }
        return false;
    }