title: Passing data bind parameter to a function knockout
body: <p></p>
  
  <p>I want to format Price and print it in proper format. For example, 5000000 will be displayed as $5,000,000. Can anyone tell me how it can be done?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;span data-bind="text:Price"&gt;&lt;/span&gt;
  
  &lt;span data-bind="function()"&gt;&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can I write an inline function which will take the value and format it? Can the value of text: Price be passed to formatfunction()?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>formatfunction(label){return  '$' + label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");</code></pre>
  </div>
  </div>
  </p>