epeli/underscore.string — pull request #130 by abuisman (2012-06-13 02:36:40+00:00)
Title: Added castNumber function

I added a castNumber function that will more forcefully create a number out of a string. This is useful for processing things like prices or percentages.

Either interesting as a new function, or as an addition to the existing toNumber function.

**castNumber** _.castNumber(string, [decimals])

Cast string to number. It will return NaN if can't be cast to number.

```javascript
_('$2.556').castNumber()
=> 3

_('2.556').castNumber(1)
=> 2.6

_('We are looking for 2 droids').castNumber()
=> 2
```