title: Binding a computed property in a text input with Ember.js
body: <p>I'm using the answer from <a href="https://stackoverflow.com/questions/17374203/bindings-computed-property-in-ember-textfield">Bindings Computed Property in Ember TextField</a>, but would like to have it expanded upon a bit.</p>
  
  <p>Here's my template:</p>
  
  <pre><code>{{input id="dollars" name="dollars" value=formattedDollars class="form-control"}}
  </code></pre>
  
  <p>And in my controller:</p>
  
  <pre><code>formattedDollars: function(key, value) {
      var model = this.get('model');
      if(value) {
          //This is the setter--make sure the stored value is an integer
          model.set('dollars', +value.toString().replace(/[^\d]/, ""));
      } else {
          //This is the getter--return a formatted value
          return model.get('dollars').toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
      }
  }.property('model.dollars')
  </code></pre>
  
  <p>This works if I am setting <code>formattedDollars</code> outside of the text field (e.g. <code>model.incrementProperty('dollars', 10)</code>), but if I actually type within the text input, the value does not stay formatted.</p>
  
  <p>I've tried also returning <code>value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")</code> in the setter, but this didn't work either. How can I make it so that typing within the <code>dollars</code> input field automatically formats the number?</p>