title: WPF-How to change number of decimal places in Textbox from code behind
body: <p>I have an application with lots of  textboxes storing currency values for which i used Infragistics control ,but there are issues with infragistics dll so decided to move to native controls like TextBox.In infragistics i could set number of decimal places in code behind using this for 3 decimal places</p>
  <pre><code>txtInvoiceAmount.Mask = &quot;{double:-15.3}&quot;;
  </code></pre>
  <p>using this for 2 decimal places</p>
  <pre><code>txtInvoiceAmount.Mask = &quot;{double:-15.2}&quot;;
  </code></pre>
  <p>Is there an easy way to set TextBox to accept 2 or 3 decimal places in code behind in WPF?</p>