title: KnockoutJS Forcing A Computed Observable to Re-Compute
body: <p>I'm new to KnockoutJS and think it's a great tool so far :)! However, I've a question regarding computed observables, and it's as follows. On the KnockoutJS page at <a href="http://knockoutjs.com/documentation/computedObservables.html" rel="nofollow">http://knockoutjs.com/documentation/computedObservables.html</a>, there's a sample code for formatting the price. The code is as follows.</p>
  
  <pre><code>HTML
  &lt;p&gt;Enter bid price: &lt;input data-bind="value: formattedPrice"/&gt;&lt;/p&gt;
  </code></pre>
  
  <p>And the JS:</p>
  
  <pre><code>JS
  function MyViewModel() {
      this.price = ko.observable(25.99);
   
      this.formattedPrice = ko.computed({
          read: function () {
              return '$' + this.price().toFixed(2);
          },
          write: function (value) {
              // Strip out unwanted characters, parse as float, then write the raw data back to the underlying "price" observable
              value = parseFloat(value.replace(/[^\.\d]/g, ""));
              this.price(isNaN(value) ? 0 : value); // Write to underlying storage
          },
          owner: this
      });
  }
   
  ko.applyBindings(new MyViewModel());
  </code></pre>
  
  <p>I've also copied the code and put a jsFiddle here: <a href="http://jsfiddle.net/wDvxw/" rel="nofollow">http://jsfiddle.net/wDvxw/</a></p>
  
  <p>My issue is that the value does not update itself when you enter the same thing twice. For example:</p>
  
  <p>Step 1: Enter 25.1234, it becomes $25.12
  Step 2: Enter 25.1234 again. Now nothing happens.</p>
  
  <p>My guess is that the value did not change and thus it doesn't reformat itself. May I know how I can go about fixing this?</p>
  
  <p>Thanks!</p>