Question: I know that we can extract an integer value from a string using

```
var x = "> 1";
x = parseInt(x.match(/\d+/)[0], 10));

```

How do I get a float value from a string

example: `var x = "> 1.1"`

I know we can just use `x.substring(2);`

But for a more generic solution? since the above will not give the accurate result for 

```
var x = "1.1"

```

So what is the best way to extract the float value `1.1` from 

```
var x = "> 1.1"

```

Answer: 
```
x = parseFloat(x.match(/[-+]?([0-9]*\.[0-9]+|[0-9]+)/));

```
Use [parseFloat()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat). It does exactly what you're looking for.