public static function value($str, $round = false)
    {
        if (is_string($str)) {
            $str = strtr($str, '.', '');
            $str = strtr($str, ',', '.');
        }

        $val = floatval($str);

        if ($round !== false) {
            $val = round($val, intval($round));
        }

        return $val;
    }
public static function value($str, $round = false)
    {
        if (is_string($str)) {
            $str = strtr($str, '.', '');
            $str = strtr($str, ',', '.');
        }

        $val = floatval($str);

        if ($round !== false) {
            $val = round($val, intval($round));
        }

        return $val;
    }
public static function value ( $ str , $ round = false ) { if ( is_string ( $ str ) ) { $ str = strtr ( $ str , '.' , '' ) ; $ str = strtr ( $ str , ',' , '.' ) ; } $ val = floatval ( $ str ) ; if ( $ round !== false ) { $ val = round ( $ val , intval ( $ round ) ) ; } return $ val ; }
Converte string em float.

@param $str
@param bool|int $round

@return float
Converte string em float .