jamesarosen/ember-cpm — pull request #70 by TrueNorth (2014-10-14 08:07:38+00:00)
Title: asInt, asFloat  (parseInt, parseFloat)

Adding these as a result of feedback from @cibernox in #63.

I chose these names so as not to clash with parseInt, parseFloat

### asFloat
```js
var MyType = Ember.Object.extend({
val: '6',
floatVal: 1.2,
valAsFloat: asFloat('val'), // 6.0
nothingAsFloat: asFloat(), // undefined
floatAsFloat: asFloat('floatVal'), // 1.2
nullAsFloat: asFloat(null), // null
undefinedAsFloat: asFloat(undefined) // undefined
});
```

### asInt
```js
var MyType = Ember.Object.extend({
val: '6',
intVal: 2,
floatVal: 2.6,
valAsint: asInt('val'), // 6
nothingAsint: asInt(), // undefined
intValAsInt: asInt('intVal'), // 2
nullAsint: asInt(null), // null
floatValAsInt: asInt('floatVal'), // 2
undefinedAsint: asInt(undefined) // undefined
});
```

One interesting aspect of this is the need (used my judgement here) to respect the type of the dependent property value. For example, if we have

```js
var MyType = Ember.Object.extend({
intVal: 2,
intValAsInt: asInt('intVal'), // 2
});
```
and then call
```js
var myObj = MyType.create();
myObj.set('intValAsInt', 3);
```
I would want the value of `intVal` to be `3` as opposed to `"3"`